且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

更改Eclipse自动完成(Content Assist)的行为

更新时间:2022-02-24 23:08:21

仅供参考,在Eclipse术语中,此功能称为 Content Assist .

FYI, in Eclipse terminology this feature is called Content Assist.

有什么方法可以使建议框始终可见,实时显示建议(并在没有可用建议时显示空白框)?

Is there any way to make the suggestions box visible all the time, showing suggestions in real-time (and showing a blank box when there are no available suggestions) ?

不,那不可能.您可以随时通过 Ctrl + Space (在Mac上为 Command + Space )调用它

No, that's not possible. You can invoke it any time you want via Ctrl+Space (Command+Space on Mac)

有什么方法可以向建议框添加永久的自定义建议(例如,开关案例模板或诸如public String toString()之类的代码行)?

Is there any way to add permanent custom suggestions to the suggestions box (e.g. a switch case template or a line of code like public String toString()) ?

是的,您可以通过首选项> Java > 编辑器> 模板

添加自己的模板>

Yes, you can add your own templates via Preferences > Java > Editor > Templates

有什么方法可以对建议框进行重新排序(例如,在通用函数之前是类私有变量,还是在System.out.print()之前是System.out.println())?

Is there any way to re-order the suggestions box (e.g. class private variables before general functions or System.out.println() before System.out.print()) ?

并非如此.通过首选项> Java > Content Assist > 高级,可以对提案类型中的循环"顺序进行一些控制>,但这并不是您真正想要的.我认为,提案的顺序是基于当前何时调用Content Assist的.

Not really. There is some control of the order for "cycling" through proposal types via Preferences > Java > Content Assist > Advanced, but it's not really what you're looking for. The order of proposals is, I think, based on the current context of when Content Assist is invoked.

是否有任何方法可以重新设计建议框-即更改其文本颜色,背景色,调整建议框窗口的大小并删除黄色的Java文档弹出窗口?

Is there any way to re-design the suggestions box - i.e changing its text color, background color, re-sizing the suggestions box window and removing the yellow java-doc pop-up?

所有自定义选项均位于首选项> Java > Content Assist 下;颜色选项位于首选项> 常规> 外观> 颜色和字体下,但我认为该颜色弹出窗口可能来自您的操作系统颜色设置.

All of the customization option are available under Preferences > Java > Content Assist; color options are available under Preferences > General > Appearance > Color and Fonts, but I think the colors for that pop-up might come from your operating system color settings.

如果您正在使用(或愿意使用)Eclipse Juno(4.2),则会有一个新的项目调用您可能会发现有趣的代码推荐.

If you're using (or willing to use) Eclipse Juno (4.2) then there is a new project call Code Recommenders that you might find interesting.