1. Code completion behavior Ctrl+Space lists symbols which are already imported in your source file, plus of course symbols from the java.lang package. Pressing Ctrl+Space again will list all symbols from the project class path whether imported or not. If you want to go to the list of all types immediately you can use the All Symbols Completion, which is invoked by pressing Ctrl+Alt+Space
2. Smart completion - Notice that the standard completion list box is divided into two parts separated by a black line. The first section includes smart completion items. The editor chooses these items based on the current context (i.e. around the current caret position) when completion is invoked. See other bullet points below starting with "smart" for more information and examples of this smart completion feature
3. Completing Keywords You may use code completion for completing keywords: the editor knows which keywords fit into which place in your code.
4. Field/Variable names When you introduce a new field or variable, you often want its name to mimic its type. Code completion now supports this. To prepend a prefix to the guessed name, simply type the prefix and then invoke code completion. This works for method names as well.
5. Smart completion examples
a. After new (with generics) This will help especially when you are declaring a field or variable with complicated generics.
In method call parameters Smart completion will offer only those fields, variables, methods which can be passed as an argument to the method
For exceptions In a catch block smart completion will offer only those exceptions which have been thrown in the try block but not yet caught
Parameter guessing Code completion of method calls guesses which variable, field or parameter should be used based on type and similarity of the name
Code completion ending character Notice that you may select the item of choice with different keys. Selecting with Enter you'll get what you expect. Should you select the item with ".", "," or ";" code completion will append the character you typed at the end of the completed word
Creation of elements - Invoking code completion between class members will offer to create a constructor (either a default constructor or one initializing uninitialized fields), override methods or implementation methods
Comments