How do I configure Eclipse's code auto hints?

Source: Internet
Author: User

It is not easy for programmers to remember the names of a large number of class names or class methods. If you want the IDE to be able to automatically complement all the code, that will help our programmers a lot.

The Code hints feature in the Eclipse code is turned off by default and only the input "." Will be prompted, with VS users may be less accustomed to this, VS is to enter any letter will be prompted, below say how to modify the Eclipse configuration, turn on the code automatic prompt function to open the Eclipse-> Window-> perferences-> Java-> Editor-> Content Assist, find auto-activation in the bottom right column, with three options to find the second "auto activation triggers for Java:" option followed by You will see a "." in the text box. Exist.

This means that only the input "." Then there will be code hints and automatic completion, and that's where we're going to change it. Put the "." in the text box. Replace it and replace it with "abcdefghijklmnopqrstuvwxyz." So that you can write Java code in Eclipse and press "ABCDEFGHIJKLMNOPQRSTUVWXYZ." Any character in any of the characters will have code hints.

It's a great thing to quickly complete code when you're writing code with a few characters. But by default, Eclipse is only when you're typing '. ' (dot character), will pop up automatically fill the window to give you the choice. Most of the time it was completely inadequate.

Because eclipse itself has many options that are turned off by default, developers can only configure them manually.

So how do you configure Eclipse's code auto hints?

1, window--> preferences--> java--> editor--> Content Assist

1) Tick the check box on the diagram

2 The automatic completion of the total delay time [auto activation delay (ms)] By default is 200ms, you can shorten some of the time, such as I set 2ms.

3 [Auto activation triggers for Java] auto-complement trigger, default is ".", this position can be set to 26 letters plus '. ' :. ABCDEFGHIJKLMNOPQRSTUVWXYZ (case-insensitive)

4) [Auto activation triggers for Javadoc]javadoc trigger, default is "@#".

2, Eclipse code automatically prompts the successful setting:

However, Eclipse does not allow you to enter such characters, the text box allows a maximum of 4 characters, so you want to modify the configuration file to implement the method, the following steps:

1. Open eclipse, then "window" → "Preferences"

2. Select "Java", expand, "Editor", select "Content Assist".

3. Select "Content Assist" and then see the "Auto activation triggers for Java" option under "Auto Activation" on the right side. Actually, it means that the trigger code hint is "." This symbol.

4. "Auto activation triggers for Java" option, in "." After adding ABC letter, easy to find the following changes. Then "Apply" and click "OK".

5. Then, "File" → "Export", in the pop-up window select "General" → "perferences", click "Next".

6. Select the export file path, I export to the desktop, enter "ABC" as the file name, click "Save".

7. On the desktop to find just in the saved file "ABC.EPF", right-click Select "Open with Notepad."

8. Press "CTRL + F" shortcut, enter ". ABC" and click "Find Next".

9. The configuration information for ". ABC" was found as follows:

10. Change ". abc" to ". ABCDEFGHIJKLMNOPQRSTUVWXYZ (,", Save, close "TEST.EPF".

11. Back to the MyEclipse interface, "File" → "Import", in the pop-up window select "Perferences", click "Next", select

Choose just in the "ABC.EPF" file that has been modified, click "Open", click "Finish". This step is similar to the previous export step.

12. The modification is complete, the test will be OK.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.