在Eclipse中输入前进的自动完成 [英] Type ahead autocompletion in Eclipse

查看:177
本文介绍了在Eclipse中输入前进的自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Eclipse可以使用像Visual Studio一样的前端自动完成插件,所以我不必一直按 Ctrl + 空格来销毁空格键。 (如果你不知道它在Visual Studio中的工作原理,请不要麻烦回答)。



而且,我可以将自动填充限制为导入的包,比地球上的每一个Java类?当我和GWT一起工作时,看到了awt和swing等的建议。而且我不想将每个Java类添加到过滤器中,这只是愚蠢的。 (再次,就像在Visual Studio中做的一样)

解决方案

关于你的第二部分,,通过重新定义方法 getCompletionProposalAutoActivationCharacters(),需要一个触发表示完成的字符列表(再次,不是您要查找的)。 >

2011年11月更新:



Cristi 他的回答(upvoted)中提到了一个很好的解决方法,其中包括将所有字母添加为java的自动激活触发器。

另请参见自动打开完成窗口在Eclipse



从线程 Eclipse自动完成

  Windows  - >偏好 - > Java  - >编辑 - >内容辅助





  • 将延迟设置为:0 (实际上> 0是更好的:50,它避免了CPU选择,因为不断的收听)

  • 设置触发器为:




 
。(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV WXYZ @


Do Eclipse have a plugin for type ahead autocompletion like Visual Studio, so I don't have to destroy my spacebar by pressing Ctrl+Space all the time? (If you don't know how it works in Visual Studio, please don't bother answering.)

And also, can I limit the autocomplete to imported packages, rather than every single Java class on earth? It's fustrating seeing suggestions from awt and swing etc., when I'm working with GWT. And I don't want to add every single Java class to the filter, that's just stupid. (Again, like how it's done in Visual Studio!)

解决方案

Regarding your second part, yes you can

  • Open Eclipse
  • Select Window/Preferences from the menu
  • Expand Java/Appearance/Type Filters from the menu on the left
  • Click the "Add package" button, enter "java.awt" (without the quotes) and click OK
  • OK your way out

This will make Eclipse remove any matching classes from the java.awt package from your type ahead list. Very nice...

So "type-ahead" exists in Eclipse (mentioned in this status report in June 2006), but is synonym of auto-completion, most often triggered by CTRL+ Space... (which is not exactly what you are looking for)


To be more specific, the kind of automatic auto-completion (completion while you are typing, with a "Common" or "All" list of possible completions) you have in Visual Studio is not there in Eclipse (actually read below):

Original answer January 2010:

At least, not without a dedicating plugin.
And even with that plugin, it would have to follow a TemplateCompletionProcessor, meaning it would need a list of characters triggering said completion (again, not what you are looking for), by redefining method getCompletionProposalAutoActivationCharacters().

Update November 2011:

Cristi mentions in his answer (upvoted) a great workaround, which consists adding all the letters as Auto activation triggers for java.
See also "Automatically opening completion window in Eclipse".

From the thread "Eclipse auto-completion ":

Windows -> Preferences -> Java -> Editor -> Content Assist

  • Set delay to: 0 (actually >0 is better: 50, it avoids CPU picks because of constant listening)
  • Set triggers to:

    .(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV WXYZ@

这篇关于在Eclipse中输入前进的自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆