简体   繁体   English

禁用 Eclipse 自动完成但保持自动激活

[英]Disabling Eclipse auto-complete but keeping auto-activation

I use Eclipse for Java development.我使用 Eclipse 进行 Java 开发。 I like the auto-activation feature because I can add all the letters and numbers so I can see class members while I'm typing;我喜欢自动激活功能,因为我可以添加所有字母和数字,这样我就可以在打字时看到班级成员; making it behave similarly to Visual Studio.使其行为类似于 Visual Studio。 If I don't add all of the letters and numbers to the auto-activation list, it will only pop up with class information when I'm typing the first letter after the '.'如果我不将所有字母和数字都添加到自动激活列表中,那么它只会在我输入“.”之后的第一个字母时弹出课程信息。 delimiter, and then it disappears.分隔符,然后它就消失了。

The real problem arises when I'm typing in a variable name or something else.当我输入变量名或其他东西时,真正的问题就出现了。 As soon as I hit space, the auto-complete types a bunch of crap following what I've typed in attempt to complete it.我一点击空格,自动完成功能就会在我输入的内容之后输入一堆废话来尝试完成它。 It's driving me crazy!这让我疯狂!

Any way to turn this off?有什么办法可以关掉这个?

The checkbox you have to check is: " Disable insertion triggers exept 'Enter' "您必须检查的复选框是:“禁用插入触发器,除非 'Enter'

(under Java -> Editor -> Content assist ) (在Java -> 编辑器 -> 内容辅助下

I'm on Eclipse 2018-12 and C_H's answer had no effect on the behavior:我在 Eclipse 2018-12 上,C_H 的回答对行为没有影响:

I believe what you'll want is to deactivate "Insert single proposals automatically"我相信您想要的是停用“自动插入单个提案”

EDIT : It seems this answer is now outdated.编辑:看来这个答案现在已经过时了。 It may work for old Eclipse versions.它可能适用于旧的 Eclipse 版本。 For any more recent versions refer to @ChrisP's answer from 2019.对于任何更新的版本,请参阅 @ChrisP 2019 年的回答。

Open menu Window , then Preferences .打开菜单Window ,然后Preferences Follow path Java -> Editor -> Content assist .按照路径Java -> 编辑器 -> 内容辅助 Now mess around with the settings to find your ideal setup.现在处理设置以找到理想的设置。 I believe what you'll want is to deactivate Insert single proposals automatically .我相信您想要的是停用自动插入单个提案

If anyone wants to know how to stop the auto-complete for brackets :如果有人想知道如何停止括号的自动完成:

Toggle off: "Edit --> Smart Insert Mode"关闭: “编辑 --> 智能插入模式” 在此处输入图片说明

Version: Eclipse Photon版本:Eclipse Photon

In continuation to @G_H's answer : This worked for me although I am sure there is another and a better way.继续@G_H 的回答:这对我有用,尽管我确信还有另一种更好的方法。

Window -> Preferences -> Java -> Editor -> Content Assist -> Set Auto Activation Delay(ms) : 200ms from 0ms in my case. Window -> Preferences -> Java -> Editor -> Content Assist -> Set Auto Activation Delay(ms) :在我的例子中从 0ms 到 200ms。 You may want to increase/decrease the value 200 depending on your typing speed.您可能希望根据您的打字速度增加/减少值 200。

The reason this worked is because of the hitting of "Spacebar" before the delay arrives.这样做的原因是因为在延迟到达之前点击了“空格键”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM