Eclipse/myeclipse variable name auto-completion problem

Source: Internet
Author: User

The principle is: After you enter the variable name, remove the press space or = after the code screen

Previously only know alt+/recall assist, and later found that all the letters can be activated content assist (8.1 in writing). It is really cool to use, but eclipse still has some default settings are not very good, such as the space bar and the = number will be the first line of content automatically screen, in fact, many times I just want to lose a space or = number. There is no way to set this in the settings, fortunately Eclipse is a plug-in mechanism, you can modify the plug-in source, and then exported to plug-ins, and then replace the original plugin to deal with.

1. Find the relevant plugin first

Open plug-ins View Find plugin Org.eclipse.jface.text, right click, select Import as Source project, after the import is complete, you can see this project in your workspace

2. Modify the Code

In the Src/org/eclipse/jface/text/contentassist/completionproposalpopup.java file, find such a line of code

Char[] triggers = T.gettriggercharacter ();

If (contains (Triggers,key))

In that line if judgment, eclipse will determine if key (that is, the key you pressed) is in the triggers, and if it is, then trigger the code on the first line below, so all we have to do is exclude the space and the = number:

if (key!= ' = ' &&key!=0x20&&contains (triggers,key))

3. Export the modified Org.eclipse.jface.text

Right click on the Org.eclipse.jface.text in your workspace, select Export-->deployable plugins and Fragments, next,destination Select archive File, then finish. You can see the generated jar in the zip file and replace it with the same name jar package in Eclipse/plugins.

if (key!=0x20 && key!= ' = ' && key!= '; ' && contains (Triggers,key))

The last is to export the modified plug-in, right-click on the project in your workspace, select Export->deployable Plugins and Fragments, click Next, select the Destination tab, Select Directory, select a catalog where you want to save the plugin, and then finish. You will then create a new plugins directory in your chosen directory with a jar file that replaces the org.eclipse.jface.text_3.6.1.r361_ inside the eclipse/plugins. V20100825-0800.jar (this file is different version of Eclipse, the later version number will not be the same, I use Eclipse 3.6), so it's done!

Eclipse/myeclipse variable name auto-completion problem

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.