Java and Web Content Assist in Eclipse
Content Assist is smart suggestions feature by looking at what the developer is currently writing. Almost all current versions of IDE’s suppot content assist feature. There have been many innovations happening in the content assist by various vendors. Here is some of the most interesting facts about Eclipse IDE on content assist:
- The core functionality is implemented by the class org.eclipse.jface.text.contentassist
- In the Eclipse preferences menu -> Editor -> Content Assist, you can set options about auto completion insert, activation delay and javadoc triggers etc.
- The content assist feature is invoked automatically by using the . (dot) operator, pressing Ctrl+Space or typing javadoc @ character
- If you can’t use Eclipse IDE’s content assist feature then you should try 1) New Project workspace 2) Restart Eclipse with -clean option 3) Some other program has not captured the Ctrl+Space key combination.
- You can create your custom content assist feature by making use of the extension points exposed by Eclipse. Java Completion Proposal Computer and Xtext and ContentAssistContext are good points to start.
- Some of the innovative features of Eclipse about content assist are 1) Shortcuts like sysout followed by Ctrl+Space for System.out.println 2) variables/methods/data type suggestions without being case sensitive.
- For web applications, project Zen Coding was created which provided auto-complete and other high speed coding features. This project is now being used almost all editors including Eclipse for web application code. Note that zen coding plugin is not for Java code.