Update
This was fixed in Eclipse 2018-12. This behaviour is still default, but can be configured off - see the accepted answer https://stackoverflow.com/a/53876787/1082449 for how
I'll leave the question as it was for posterity, and for those on earlier versions of Eclipse
在 Eclipse 中,我通过以下方式启用了 Java 的智能感知风格建议:
Window -> Preferences -> Java/Editor/Content Assist
并设置以下内容
Auto activation delay (ms) -> 0
Auto activation triggers for Java -> .(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
来源=Eclipse 智能感知? https://stackoverflow.com/questions/2943131/eclipse-intellisense
This works brilliantly, apart from one annoying problem. When I hit spacebar, the token being typed is autocompleted with whatever is at the top of the suggestions list. Fair enough, except that sometimes I'll type a class/variable name with an exact legal match, but this won't appear as the top suggestion. So when I naturally hit spacebar Eclipse inserts something completely wrong.
E.G. after typing Cookie
I'll hit spacebar and get CookieMonster
.
This seems like a bug, and happens often enough to be annoying, but even despite this I don't want spacebar to trigger autocomplete in general. I may want to type a variable name which hasn't been declared yet, or something similar. I want to use autocomplete as a helper tool, but my natural typing should always take priority over it.
I'd like to stop spacebar triggering autocomplete, and either fall back to using enter, or better still trigger autocomplete with a custom key not used in ordinary typing. Is any of this possible?
我已经尝试过所有设置内容协助无济于事。谷歌搜索这个问题只会返回一堆关于禁用自动完成功能的结果。
此问题已从 Eclipse 2018-12 [4.10] 中修复 see 接受的答案 https://stackoverflow.com/a/53876787/1082449
它存在于所有以前的版本中,即2018-09 [4.9], Photon [4.8], Oxygen [4.7], Neon[4.6]等.