在Eclipse中设置好代码提示功能后,虽然方便了敲代码,但是有一个很让人头痛的问题,就是当一个对象名打出来以后,会有相应的代码提示,但是我不想使用当前提示的代码,只想输入空格或者等号继续下一个操作,但是eclipse会自动帮你选择当前所提示的代码,所以要解决此问题。
1.首先查看当前Eclipse的版本,然后下载相应的SDK工具包(http://archive.eclipse.org/eclipse/downloads/)
2.启动下载的sdk包下的eclipse,打开后选择工具栏的window->show view>plugin development->plugin-ins
3.在打开的视图中查找到org.eclipse.jface.text,右键选择Import->Source project,即可在左侧视图中看到导入的项目
4.在导入的项目中,找到/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java 源码,修改如下:
//if (contains(triggers, key)) {
//排除对=和空格的监控
if(key!='='&&key!=0x20&&key!=';'&&contains(triggers,key)){
e.doit= false;
hide();
insertProposal(p, key, e.stateMask, fContentAssistSubjectControlAdapter.getSelectedRange().x);
}
5.
右键 org.eclipse.jface.text --> Export-->Plugin-in Development-->Deployable plug-ins and fragments-->Next
选择导出包的位置,然后将导出的jar包替换掉eclipse中plugins目录下的同名jar包,重启eclipse即可。