Eclipse not giving me variable name suggestions
Solution 1
I believe you are trying to get variable name e.g. color
after private Color
where Color
is you class i.e. private Color color
. I see that working in my eclipse.
To verify your settings, go to below settings and verify as they look good to you.
Windows -> Preferences -> Java -> Editor ->Content Assist
and
Windows -> Preferences -> Java -> Editor ->Content Assist -> Advanced
Solution 2
This is the default behavior after entering a Java type and a space, and then pressing CTRL+Space to activate auto-complete. For example, if you enter:
private Color
then activate auto-complete it will suggest some variable names for you.
An easier way than having to press CTRL+Space all the time is to change the characters which automatically activate auto-complete. I find it very useful to have all characters which could possible be variable names to activate auto-complete. Try having ._abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
as Auto activation triggers for Java
found in Preferences -> Java -> Editor -> Content Assist:
This way you can achieve how Visual Studio handles auto-complete.
Solution 3
Goto Window -> preferences -> java -> Editor -> content Assist ->Advances -> Select all the check boxes. DONE :)
Solution 4
I tried them one after the other and found out that the correct one is:
Windows -> Preferences -> Java -> Editor ->Content Assist -> Advanced
: check Word Proposals
Solution 5
private
? It looks like you're creating something new.. eclipse cannot suggest in this case.
Autocomplete is for existing variables/functions/classes/etc.
Arturas M
I'm a technology enthusiast and a Java Software Engineer
Updated on November 12, 2020Comments
-
Arturas M over 3 years
well I've seen in Tips & Tricks of Eclipse that it's possible to get a variable name generated by eclipse by clicking Ctrl + Space. However I'm getting empty suggestions. Fors instance I'm typing this and click ctrl + space:
private Color
And I am supposed to get some name suggestions on it? All I'm getting is an empty list of suggestions. So what's turned off? Any idea?
Thanks in advance.
This is what I want to achieve:
-
Ionut Hulub over 11 yearsdo it doesn't generate names. it only works after you have created some variables. you type the first letter/letters and when you click ctrl + space you get a list of all the variables that start with that letter/letters. it's an auto-complete tool...
-
Jimmy over 11 yearscheck the settings : Windows > Preferences > Java > Editor > Content Assist > <>
-
xedo almost 9 yearsdid you find a solution? could you posted it?... the answers don't really solve the problem
-
-
Arturas M over 11 yearsYeah, that's what I'm looking for, however it doesn't seem to work. I tried selecting all of those things in Content Assist, but they don't generate that "color" for me and don't suggest it...
-
Yogendra Singh over 11 yearsIn
advanced
screen, do you see proposals being listed? If yes, are they selected? -
DDS about 5 yearsAnswer looks useful, but in 'C/C++' perspective is impossible to bind with an arbitrary list of characters, is there a way to do it anyway?
-
laurent almost 5 yearsPrecisely, you want to check the "Java Type Proposals" to achieve what you want.