Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot easily type a range when "Enable auto activation" for code assist is enabled #676

Closed
mauromol opened this issue Aug 14, 2018 · 4 comments
Assignees
Milestone

Comments

@mauromol
Copy link

Ensure the following option is enabled: Window | Preferences | Java | Editor | Content Assist | Enable auto activation. Set the delay to ms.
Then create a Groovy class and try to write a range (like (1..2)) in a method body, by typing each character one by one. You'll end up with: (1.TYPE.2)
This is because after the first dot content assist starts and the second dot performs as a trigger character that causes the first suggestion (TYPE constant defined in Class) to be inserted.

Hint: maybe . should not be treated as a trigger character when following another ..

Note 1: why content assist talks about Void.TYPE instead of Integer.TYPE (like F3 does, after you type it)?
Note 2: maybe I am missing something obvious, but why this constant (which is defined in Class class) is available as a static reference access in an instance variable?

@eric-milles
Copy link
Member

I can easily disable . as a trigger for proposals in this case. When looking at it, I was trying to leave . triggering once user navigates in proposal list or types a prefix character or completion is 2nd dot and beyond. I have some of that prototyped.

I also experimented with increasing the auto-activation time. 50 ms was not enough delay to stop the completion. I'm not sure the necessary throshold; maybe you could find a number of ms delay that would allow ranges without proposal completion.

As for the Void.TYPE proposal; I added it to my todo list...

@mauromol
Copy link
Author

When looking at it, I was trying to leave . triggering once user navigates in proposal list

Ok, but consider the case in which the proposal list has just one item (probably difficult, unless you start to type something, but it's hard to guess): in that case . in general may well be used as a trigger character to "instantly" add the proposed element, IMHO. So, probably, simply disabling . has a trigger character when preceded by another . would be the easiest solution (in which actual case you think that . can be used as a triggering character after the 2nd dot?), but I'll let you decide what you think is the best solution.

@eric-milles
Copy link
Member

Ready to test

@mauromol
Copy link
Author

Hi Eric, I'm testing with 3.1.0.xx-201808210011-e47. It works, in the sense that I can type the range without having the "TYPE" element automatically inserted.
However I noticed a slight inconsistency in subsequent code assist for which I'll open a new report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants