I just started to use Juno for a couple of days, the content assist mechanism seems different from what it behaves before.
For example, if I try to declare a variabl
It seems that it is not possible. See answers to Eclipse Bug 378588: https://bugs.eclipse.org/bugs/show_bug.cgi?id=378588
Not a perfect solution:
Window->Preference->Java->Editor->Content Assist->Auto activation Triggers for Java: .ABCDEFGHIJKLMNOPQRSTUVWXYZ
In this way, only classes and types will be popped up for proposals.
Just a suggestion, the choice is up to you.
This is still a problem in Eclipse 2018-12 and it only seems to occur if you changed the Auto activation triggers for Java
setting to e.g. ._abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
, which'll make the Content Assist (almost) always pop up, even without pressing Ctrl+Space (Windows).
There's a new setting that was added in Eclipse 2018-12 and makes it a bit less annoying (mentioned in the comments below the bug report):
In Window - Preferences - Java - Editor - Content Assist
tick the Disable insertion triggers except 'Enter'
box.
With this setting enabled, Content Assist is still going to trigger (depending on the other settings) but you have to press Enter to accept a suggestion.
What you see there is name completion for object types. And this may often make sense, e.g. pressing Ctrl-Space after List book
will complete that to List bookList
. For primitive types this is not done, so int count
will not get any completion when pressing Ctrl-Space. This would be a (not really good) solution to your problem by declaring the variable as primitve boolean.
What I really recommend as solution is to change your style of writing variable declarations. For your example, write isVisible = false
instead, have the editor complain about the missing type declaration, hit Ctrl-1 (from wherever your cursor might be placed), Enter.
Based on the discussion for Eclipse Bug 412992, check your Content Assist Auto Activation settings: Window->Preferences->Java->Editor->Content Assist
If, for example, characters a-z are listed as "Auto activation triggers for Java", you can remove them and the type name will not be auto-appended to a new variable name when you hit ' ' or ';'. It's up to you to determine the best configuration/tradeoffs for your style based on the available options.