Tab 在 Eclipse 中选择自动完成项目?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5611448/
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-10 20:06:57  来源:igfitidea点击:

Tab to select autocomplete item in eclipse?

eclipseconfigurationautocompleteintellisensepreferences

提问by Carl R

I can't find either the term autocompleteor intellisensein Preferences->General->Keys in Eclipse 3.6.2.

我在 Eclipse 3.6.2 中的 Preferences->General->Keys 中找不到术语自动完成智能感知

I don't want to press enter to select an autocomplete item when I write code. Can I configure Eclipse to accept an autocomplete item with the tab button?

我不想在编写代码时按 Enter 键选择自动完成项。我可以将 Eclipse 配置为接受带有选项卡按钮的自动完成项目吗?

采纳答案by AM__ZB

Just got it, go to Window>Preferences>General->Keys and look for "Word completion" as said before. Then near the bottom is "Binding" and to the right of it, a box with an arrow, clicking there you can select "Tab" to use Tabulator for autocomplete.

刚搞定,转到窗口>首选项>常规->键,然后像之前说的那样查找“单词完成”。然后在底部附近是“绑定”,在它的右侧是一个带箭头的框,单击那里您可以选择“Tab”以使用 Tabulator 进行自动完成。

回答by Ben

I believe you are looking for "word completion" Left Alt + / though you can change it in "Preferences->General->Keys" to be whatever key combo. Pressing / multiple times cycles through the different suggestions. It's not very intelligent. For example if you have String apple;and double apps;and you type double x = aand then Alt + / eclipse might suggest apple instead of apps, even though apple is an String.

我相信您正在寻找“单词完成”Left Alt + / 尽管您可以在“首选项->常规->键”中将其更改为任何组合键。按 / 多次循环显示不同的建议。它不是很聪明。例如,如果你有String apple;anddouble apps;并且你输入double x = a然后 Alt + / eclipse 可能会建议苹果而不是应用程序,即使苹果是一个字符串。

Edit: Looks like it's ctrl + / on some computers.

编辑:在某些计算机上看起来它是 ctrl + / 。

回答by Max

The autocompletion selection key(s) is editor specific. For instance in Aptana Studio, you could define set of keys for proposal selection. See e.g. Preferences/Aptana Studio/Editors/JavaScript. PyDev shares some code with Aptana Studio, so it has similar capabilities. See "Preferences/PyDev/Editor/Code Completion/Apply completion on *" checkboxes.

自动完成选择键是特定于编辑器的。例如,在 Aptana Studio 中,您可以为提案选择定义一组键。参见例如首选项/Aptana Studio/Editors/JavaScript。PyDev 与 Aptana Studio 共享一些代码,因此它具有类似的功能。请参阅“首选项/PyDev/编辑器/代码完成/在 * 上应用完成”复选框。

Speaking of the Tab key as a selector, it doesn't seem possible w/o extra coding since it has special meaning to focus into proposals window. For these who interested could find Tab handling at org.eclipse.jface.text.contentassist.CompletionProposalPopup.verifyKey(VerifyEvent)

说到作为选择器的 Tab 键,它似乎不可能没有额外的编码,因为它具有特殊的意义,可以聚焦到建议窗口。对于那些感兴趣的人可以在 org.eclipse.jface.text.contentassist.CompletionProposalPopup.verifyKey(VerifyEvent) 找到 Tab 处理

Cheers, Max

干杯,马克斯

回答by Browny Lin

You can use this trick as mentioned -> https://stackoverflow.com/a/6508181/474002

您可以如上所述使用此技巧-> https://stackoverflow.com/a/6508181/474002

After you jump to the item you want, press Tab-> Space

跳转到您想要的项目后,按Tab->Space

It's done. Hope this will help :)

完成。希望这会有所帮助:)

回答by Ali

I believe the same question is asked here Change hotkey for autocomplete selection

我相信这里会问同样的问题更改自动完成选择的热键

All key bindings in Eclipse are defined in Window -> Preferences -> General -> Keys. I don't think you can change what is used to select stuff from the autocomplete list, but you can use space to select and then Enter for new line.

Eclipse 中的所有键绑定都在 Window -> Preferences -> General -> Keys 中定义。我认为您不能更改用于从自动完成列表中选择内容的内容,但您可以使用空格进行选择,然后 Enter 换行。