In the process of using eclispe, I feel that automatic completion is not good, and VS is not powerful. The following are two methods for auto-completion enhancement:
1. added the eclipse prompt function.
In eclipse, under window> preferences> JAVA> editor> content assist> auto-activation ". add the first subtitle that we need to prompt automatically after ", for example," ABC ". You can add all the uppercase and lowercase letters (. abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz _).
2. Modify the shortcut key for auto-completion
First, open eclipse, open window-> show view, select plug-ins, and find Org. eclipse. jface. text, right-click, and select import as-> source project. After the import is complete, you can see the project in your workspace.
There is a piece of code in the "org. Eclipse. jface. Text. contentassist. completionproposalpopup # verifykey ()" function under the Import project:
// key != 0 switch (key) { case 0x1B: // Esc e.doit= false; hide(); break; case '\n': // Ctrl-Enter on w2k case '\r': // Enter e.doit= false; insertSelectedProposalWithMask(e.stateMask); break; case '\t': e.doit= false; fProposalShell.setFocus(); return false; default: ICompletionProposal p= getSelectedProposal(); if (p instanceof ICompletionProposalExtension) { ICompletionProposalExtension t= (ICompletionProposalExtension) p; char[] triggers= t.getTriggerCharacters(); if (contains(triggers, key)) { e.doit= false; hide(); insertProposal(p, key, e.stateMask, fContentAssistSubjectControlAdapter.getSelectedRange().x); } } }
Modify this code:
// key != 0 switch (key) { case 0x1B: // Esc e.doit= false; hide(); break; case '\n': // Ctrl-Enter on w2k case '\r': // Enter e.doit= false; insertSelectedProposalWithMask(e.stateMask); break; case '\t': e.doit= false; insertSelectedProposalWithMask(e.stateMask); break; default: ICompletionProposal p= getSelectedProposal(); if (p instanceof ICompletionProposalExtension) { ICompletionProposalExtension t= (ICompletionProposalExtension) p; char[] triggers= t.getTriggerCharacters(); if (key!='='&&key!=0x20&&key!='.'&&key!=';'&&contains(triggers, key)) { e.doit= false; hide(); insertProposal(p, key, e.stateMask, fContentAssistSubjectControlAdapter.getSelectedRange().x); } } }
This will cancel the auto-completion of "=", space, ".", and ";", and add the tab auto-completion.
Finally, export the modified plug-in. Right-click the project in your workspace, select export-> deployable plugins and fragments, click Next, select the destination tab, and select directory, select a directory to save the plug-in, and then finish it. A zip package is displayed, and a jar package is displayed in plugins, replace the file with the same name in the Plugins under the eclipse directory (you 'd better first put the org. eclipse. jface. text_3.7.2.v20111213-1208.jar (because different versions of eclipse may have different names for this file) backups ).
It will be nice to use eclipse after modification!
20:49:38
The default Tab key is used to locate the next parameter in auto-completion.