Resolve the annoying complement behavior of variable names when declaring a variable after eclipse enables enhanced auto-completion

Source: Internet
Author: User

I've been mixing with Visual Studio, I've been writing Java recently, and I've used eclipse, and it's been a lot of good places.

But because of the "IntelliSense" that is used to VS, the activation trigger (Auto triggers for Java) is changed from '. ' To ' a-za-z ' under Eclipse to simulate

In general, the performance is consistent with expectations, and there is only one place that is awkward, that is, when declaring a variable, the IDE triggers the completion of the variable name, and the complement is easily mistaken, which is very disturbing in practice.

Fortunately, Eclipse is an open source project, and based on the plug-in mechanism to provide a good support for custom behavior, it took two days to study, found a solution, provided as follows, for the same friends I am troubled:

1. Download eclipse with full source, such as Eclipse-sdk-3.6-win32
2. Enter Plug-in Development View
3. Find the Org.eclipse.jdt.core package, Right key Import as ... Source Project
4. Go to the imported item: Org.eclipse.jdt.core, find the class Org.eclipse.jdt.internal.codeassist.CompletionEngine, where the method Completiononfieldname and Completiononlocalorargumentname are related to variable name completion when declaring variables, and they will eventually call to Method Findvariablename, where an internal interface object is defined in the method Inamingrequestor, modifying the Accept method of this object can affect the final processing of JDT to completion
5. I made a simple conversion, that is, to insert a name = new char[] {} In the Accept function header, and clear the JDT incoming The completion of the full result, thereby canceling the variable declaration when the spoiler's complement of the hint
6. After the modification, on the project Org.eclipse.jdt.core on the right key Export ... Deployable Plug-ins and fragments solves the problem by overwriting the exported custom Org.eclipse.jdt.core package to eclipse plugins.

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.