eXo IDE currently supports special features for the Groovy code auto-complete list, including REST Service ("application/x-jaxrs+groovy"), POJO ("application/x-groovy") and Data Object ("application/x-chromattic+groovy"). The auto-complete list varies, depending on Java types and is shown in the following cases:
<local variable name>
<object's field name>
<static field name>
<method's parameter name>
<class name>
@<annotation name>
in the line after the space
IDE compiles classes, which are described in the project's classpath, before generation of the auto-complete list. If the compilation of some classes is failed, the error message will appear in the Output panel instead of Auto-complete form as shown below:
[ERROR] Error (500: Internal Server Error) startup failed, /ide-project/data/Pojo.groovy: 9: unexpected token: vpid @ line 9, column 3. vpid fg(){ ^
To display classes from folder described as folder source in the project's classpath, in the Auto-complete form, the files with such classes must fulfill the following conditions:
Be located in folder with respect to package structure.
Have the same file name as the class name located in a file.
Have the .groovy or .grs extension.
The Groovy code specific auto-complete list supports 5 cases as follows:
You can view class's JavaDoc and class name from the Auto-complete form. eXo IDE provides appropriate import statement into the file header automatically, if needed. There is a list of default packages for the Groovy code and so are imported explicitly:
There is a list of default packages for the Groovy code and so are imported explicitly:
java.lang
java.io
java.lang
java.math.BigDecimal
java.math.BigInteger
java.net
java.util
groovy.lang
groovy.util
Object's fields and methods auto-completion
You can also view JavaDoc and auto-complete the object's fields and methods as follows:
Print the instance name with the dot (.) at the end.
Press Ctrl+Space to view all public methods and fields of the object. The JavaDoc for the selected field or method is shown.
Select the appropriate item in the Auto-complete form and press the Enter key; or double-click this item.
Static fields and methods auto-completion
eXo IDE supports the auto-completion of static fields, methods and object's fields and methods.
The auto-completion for methods and fields of the class or instance can only work if it is called after the symbol ".".
It is possible to auto-complete the annotations, followed by the symbol "@". The Auto-complete form for annotation contains the list of available annotations like this:
Local variables and parameters auto-completion
Local variables and method's parameters are marked with in the Auto-complete form. eXo IDE supports the auto-completion for local variables and method's parameters.
Besides, the keywords of Groovy code are not marked with icons in the auto-complete list.