'Eclipse Content Assist is Appending Class Name to Variable Suggestions
Content Assist in Eclipse Juno is appending the Class name of variables to suggestions. For example, if I start to type:
private String firstName
and hit Return, Eclipse changes this to:
private String firstNameString;
I don't know if this is specific to Juno or if I accidentally turned this 'feature' on, but it is really annoying. Any idea how to get rid of this?
Solution 1:[1]
This problem 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.
As nitind mentioned, typing a variable name should always end in a comma, semi-colon or space but pressing Enter should be okay. 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.
Solution 2:[2]
In the Spring Tool Suite got to Window -> Preferences -> Java -> Editor -> Content Assist then- check the option "Disable insertion triggers except 'Enter'. "
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Neph |
| Solution 2 | Jatin |
