Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse not giving me variable name suggestions

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: enter image description here

like image 953
Arturas M Avatar asked Oct 17 '12 01:10

Arturas M


2 Answers

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
like image 168
Yogendra Singh Avatar answered Sep 19 '22 15:09

Yogendra Singh


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:

Screen shot of the Content Assist settings

This way you can achieve how Visual Studio handles auto-complete.

like image 26
Michael Fulton Avatar answered Sep 20 '22 15:09

Michael Fulton