当我输入一个左括号('(')?时,如何让Eclipse不要填写自动完成?

Jan*_*hem 8 eclipse autocomplete key-bindings

因此,在Eclipse Luna上,我经常遇到我正在键入方法名称的情况,但是第一个自动完成建议不是我要查找的方法,而是前缀等效但更长的东西,如下例所示:

无用的自动填充建议

在这个例子中,我只是想要这个element(String name)方法,所以不是点击Return,而是输入(.结果非常令人讨厌,是这样的:

意外触发自动完成后

这显然不是我想要的.当我点击open-parenthesis(()时,有没有办法防止Eclipse执行自动完成?

这些是我的内容辅助设置(很明显,我在这个eclipse安装中根本没有安装代码推荐器): 内容辅助设置 在此输入图像描述

小智 6

In Eclipse 4.11 (2019-03), and possibly earlier, the answer to this is under Preferences ? Java ? Editor ? Content Assist ? Disable insertion triggers except 'Enter'. After I checked that box, editing became a lot less annoying.

I have no idea why Eclipse doesn't do it by default. Who types map.put( and wants that to autocomplete to map.compute()?

  • 这对我有用 - 谢谢。确实很烦人的事情,而且它是一个错误。我发现 Eclipse (4.6.3) 在这方面做得更好。输入“map.p”后,自动建议首先建议 put(...) 方法。 (4认同)

Mat*_*ias 1

您正在使用的功能是新的“智能代码完成”,它根据平均使用计数对方法进行排序。不要问我他们从哪里获得数据。另请参阅此处: http ://www.eclipse.org/recommenders/manual/#intelligent-code-completion

要禁用该功能,请转至首选项页面代码推荐|完成并取消选中“启用智能代码完成”。