I use Map a lot in Java with eclipse. e.g.
Map<String, String> map = new HashMap<>();
then when I am ready to add something with put:
String key = null;
String value = null;
// somewhere before the put, key and value get populated with Strings
map.put(key, value);
the problem is, every time I type "map.put", Eclipse autocomplete changes it to "map.compute()" so I have to edit and remove the "com" and the "e".
I looked at Window -> preferences -> Java -> Editor -> Content Assist but nothing was apparent. I could, I suppose, turn off all content assist, but that would be like "throwing the baby out with the bath water". There are a lot of useful things in the content assist.
My Eclipse:
Eclipse IDE for Enterprise Java Developers. Version: 2018-12 (4.10.0) Build id: 20181214-0600 OS: Windows 10, v.10.0, x86_64 / win32 Java version: 1.8.0_144
How can I fix eclipse so it will make the correct suggestions like it did in previous versions?
The solution is not to tick/untick some stuff under Windows->Preferences->... ->Content Assist-> Advanced. I checked if "ctrl+space" is hijacked by some other thing which is not and checked keyboard language which is English(Those are suggested in mkyong).
By default Eclipse triggers the autocompletion after a certain delay when you insert a dot. This is sensible because the dot signals the IDE for example that you got an instance of a class and want to call a method on it. You can bring up the autocompletion by manually pressing Cmd plus Space whenever you want.
In the Window > Preferences menu, you can search for spell checking (located in General > Editors > Text Editors > Spelling) and there you can edit your spell checking options.
After upgrading Eclipse my Java autocomplete suggestions (Ctrl-Space) stopped working. Here is how to fix it Now make sure the following are all ticked in the top and bottom sections: Apply the changes and then close and re-open your project and it will build the autocompletions which will then become available when you hit Ctrl-Space.
A "Java Proposals (Code Recommenders)" was enabled in old workspace which is absent in new version 4.22. Therefore Java autocomplete was disabled after upgrade. Problem solution was to check the entry "Java Proposals" in Content Assist YES. Same applies to upgrade from 4.23 to 4.24.
QUICK FIX: Create a new workspace on the new desired location and import the projects from the old workspace. Do not forget to check the “Copy projects into workspace” checkbox so that the projects get copied to the new workspace directory. From this point on autocomplete should be back on its feet.
The UI doesn't make it easy to search for conflicting bindings... and Auto-Complete is still broken. on the first . if I hit ^space, it DOES find a bunch of "chain template proposals", through getClass () and toString ()...
None of the proposed solutions worked for me. What fixed it was to disable "Show substring matches" (in Preferences -> Java -> Editor -> Content Assist
).
It should be considered that this will break the functionality to just type a random part of the desired reference, e.g. typing "PreparedStatement" no longer leads to OraclePreparedStatement
. A feature that I don't care about, but this is obviously a matter of personal preference.
In my opinion, the name of that option is a slight misnomer since the substring aspect only applies to leading and not to trailing content.
Update: In Eclipse 2020-06, there is no longer an option "Show substring matches". In its place there is "Show subword matches", but even when disabled, suggestions for typing map.put
still include compute
. At least when sorted by relevance rather than alphabetically, put
is listed in the suggestions before compute
.
Window->Preferences Java->Editor->Content Assist->Advanced
Unchecking "Java Proposals (Task-Focused)" and instead checking regular "Java Type Proposals" fixed the problem for me. I'm using Eclipse for Enterprise Java Developers 2019-03 on Windows 10.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With