Eclipse代码自动完成功能
2013-03-02 14:11
405 查看
down voteaccepted | Found the answer via this question: Auto Code Completion on Eclipse Basically the auto activation trigger for auto-complete by default is set to only the character ".". To make code assist / auto complete trigger always, you have to change the string to: .abcdefghijklmnopqrstuvwxyz In v21.x.x version of ADT, this is located in Preferences -> Java --> Editor --> Content Assist. |
up vote15down voteaccepted | you can also set auto completion to open automatically while typing: write .abcdefghijklmnopqrstuvwxyz in "Auto activation triggers for Java" field, in Java/Editor/Content Assist. see this question for more details: Automatically opening completion window in Eclipse
| ||||
|
up vote6down vote | Use the Ctrl+Spaceshortcut for getting all possible autocomplete options available in a particular context in the editor. Auto Complete will also allow you to insert custom code templates into the editor, with placeholders for various inputs. For instance, attempting to auto complete the word "test" in a Java editor, in the context of a class body, will allow you to create a unit test that uses JUnit; you'll have to code the body of the method though. Some code templates like the former, come out of the box. Configuration options of interest Auto-activation delay. If the list of auto complete options is taking too long to appear, the delay can be reduced from Windows -> Preferences -> Java -> Editor -> Content Assist -> Auto Activation delay (specify the reduced delay here). Auto activation trigger for Java. Accessible in the same pane, this happens to be the .character by default. When you have just keyed in typeA.and you expect to see relevant members that can be accessed, the auto completion list will automatically popup with the appropriate members, on this trigger. Proposal types. If you do not want to see proposals of a particular variety, you can disable them from Windows -> Preferences -> Java -> Editor -> Content Assist -> Advanced. I typically switch off proposals of most kinds except Java and Template proposals. Hitting Ctrl+Space multiple times will cycle you through proposals of various kinds. Template Proposals. These are different from your run of the mill proposals. You could add your code templates in here; it can be accessed from Windows -> Preferences -> Java -> Editor -> Templates. Configuration of existing templates is allowed and so is addition of new ones. Reserve usage however for the tedious typing tasks that do not have a template yet. |
相关文章推荐
- 完善eclipse代码提示,代码自动完成功能
- 让Eclipse支持jQuery和jQueryUI代码自动完成功能
- eclipse代码提示,代码自动完成等功能
- eclipse代码提示,代码自动完成等功能
- eclipse代码提示,代码自动完成等功能
- eclipse中安装thymeleaf插件完成thymeleaf模板中自动代码提示功能
- 自己动手设计代码编辑器——(四)代码智能提示(自动完成功能)
- 有关Eclipse的自动完成&代码整理
- Eclipse的代码自动提示功能失效的解决方法
- Eclipse/myEclipse 代码提示/自动提示/自动完成设置
- 如何配置eclipse/zend studio的代码自动提示功能
- 增强Eclipse的自动代码提示功能
- Eclipse For Android 代码自动提示功能
- Eclipse Android 代码自动提示功能
- 用代码实现在eclipse中自动生成package_这个功能很有用_java版
- Eclipse的代码自动补全功能
- eclipse代码自动提示设置、如何配置eclipse的代码自动提示功能(同时解决自动补全变量名的问题)?
- Eclipse如何让Java代码和xml代码实现自动提示功能
- 在Myeclipse中完成代码自动填充,自动提示功能的方法:以及如何在导入和导出配置文件。
- Eclipse,MyEclipse代码自动提示功能设置