- Type a name or a part of a name.
While typing, use the following techniques:
- 12.0+Narrow down the suggestion list by typing
any part of a word, even the characters somewhere in the middle, or invoking code completion
after a dot separator. IntelliJ IDEA will show suggestion list
that includes occurrences with all the possible positions of the entered characters.
This makes the use of the asterisk wildcard unnecessary:
- In case of CamelCase or snake_case names, type the initial letters only. So doing, IntelliJ IDEA automatically recognizes and matches the initial letters.
- 12.0+Narrow down the suggestion list by typing any part of a word, even the characters somewhere in the middle, or invoking code completion after a dot separator. IntelliJ IDEA will show suggestion list that includes occurrences with all the possible positions of the entered characters. 12.0+
- Do one of the following:
- On the main menu, choose .
- Press Ctrl+SpaceCtrl+SpaceCtrl+SpaceCtrl+SpaceAlt+SlashCtrl+SpaceCtrl+SpaceCtrl+Space or Ctrl+Back SlashCtrl+SpaceControl SpaceControl SpaceControl Space.
- 12.0+If necessary, press Ctrl+SpaceCtrl+SpaceCtrl+SpaceCtrl+SpaceAlt+SlashCtrl+SpaceCtrl+SpaceCtrl+Space or Ctrl+Back SlashCtrl+SpaceControl SpaceControl SpaceControl Space for the second time.
This shows all classes, available through the module dependencies. The second completion shows also static fields and methods.
This action produces the same effect as pressing Ctrl+Alt+SpaceCtrl+Alt+SpaceCtrl+Alt+SpaceCtrl+Alt+SpaceCtrl+Alt+SpaceCtrl+Alt+SpaceCtrl+Alt+SpaceCtrl+Alt+Space or Ctrl+Alt+Back SlashCtrl+Alt+SpaceControl Alt SpaceControl Alt SpaceControl Alt Space.
When invoked for the third time, basic code completion expands the suggestion list to all classes throughout the project, regardless of the dependencies.
- Select the desired class from the suggestion list, and do one of the following:
- Press EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter or double-click the desired choice .
- Press TabTabTabTabTabTabTabTabTabTabTabTab.
IntelliJ IDEA makes it possible to choose between adding Class.methodName() at the insertion point, and
adding a static import statement. In the first variant, just complete selection.
In the second variant, press Alt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+Enter, Alt+Shift+J or Ctrl+Shift+MAlt EnterAlt EnterMeta 1 in the suggestion list, and choose Import statically.
- The option Autocomplete common prefix ( ) makes IntelliJ IDEA look for common prefixes and automatically complete them in the editor. This feature is useful for the classes with numerous similar-named members.
- 11.1+If a suggestion list shows n variants of a class, type a dot, and the next suggestion list after dot will show the all possible qualified names of the members. After selecting the desired one, import statement will be added automatically.
- 12.0+Suggestion list includes literals, already defined in a file: