eclipse 日食自动完成

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14819925/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 19:59:30  来源:igfitidea点击:

eclipse autocomplete

eclipse

提问by shkra19

I have noticed that qtCreator handles the auto-completion much better than eclipse.

我注意到 qtCreator 比 eclipse 更好地处理自动完成。

For example, if I have a line that says object.firstItem()and put my cursor between .and f, and then delete the firstword (thus becoming object.|item()) and then press ctrl+spaceand choose secondItem(), qtCreator guesses object.secondItem();, whereas eclipse chooses object.firstItem()Item().

举例来说,如果我有这样一行object.firstItem(),并把我的光标之间.f,然后删除first字(从而成为object.|item()),然后按ctrl+space和选择secondItem(),qtCreator猜测object.secondItem();,而日食选object.firstItem()Item()

There could well be other features that are present in qtCreator, too, but not in eclipse, though it's the only one I really noticed. But why not share all good ideas since they all are open source ? I would be interested in all good features of qtCreator and eclipse combined.

qtCreator 中也可能存在其他功能,但 eclipse 中没有,尽管它是我真正注意到的唯一功能。但是为什么不分享所有好的想法,因为它们都是开源的?我会对 qtCreator 和 eclipse 结合的所有优秀功能感兴趣。

Is there a way to have such a behaviour in eclipse too, through configuration or through a plugin ?

有没有办法在 eclipse 中也有这样的行为,通过配置或通过插件?

回答by tobias_k

This feature is supported by Eclipse, too. (Or more specifically, the Eclipse Java Development Tools.)

Eclipse 也支持此功能。(或者更具体地说,Eclipse Java 开发工具。)

Just hold down the ctrlkey when selecting the item from the list of proposed completions to toggle between insertingand overwritingcompletion mode.

ctrl从建议的完成列表中选择项目时,只需按住键即可在插入覆盖完成模式之间切换。

To change the default behaviour, go to Preferences -> Java -> Editor -> Content Assistand change the top-most radio button from "Completion inserts" to "Completion overwrites".

要更改默认行为,请转到Preferences -> Java -> Editor -> Content Assist并将最顶部的单选按钮从“Completion inserts”更改为“Completion overwrites”。