IntelliJ IDEA 13.1 Web Help

Smart Type code completion filters the suggestion list and includes only those types that are applicable to the current context.

Thus, you can use smart type completion in the situations, when it is possible to determine the appropriate type:

  •  In the right part of the assignment statements.
  •  In variable initializers.
  •  In return statements.
  •  In the list of parameters of a method call.
  •  After the new keyword in an object declaration.
To use smart type code completion
  1. Do one of the following:
    • On the main menu, choose Code | Complete Code | SmartType.
    • Press Ctrl+Shift+SpaceCtrl+Shift+SpaceCtrl+Shift+SpaceCtrl+Shift+SpaceCtrl+Shift+Space or Ctrl+Alt+SlashCtrl+Shift+SpaceShift+Alt+SpaceCtrl+Shift+Space or Ctrl+Shift+Back SlashShift+Alt+SpaceControl Shift SpaceControl Shift SpaceShift Alt Space

    SmartType code completion automatically highlights selection in the suggestion list that seems most suitable for the current context. Such results display on a darker green background.

    For example, consider smart type code completion after the new keyword in Java:

    img

    9.0+

    or in Groovy:

    smartTypeCompletionGroovy.png

    As you type, the suggestion list reduces to show matching entries only.

  2. If necessary, press Ctrl+Shift+SpaceCtrl+Shift+SpaceCtrl+Shift+SpaceCtrl+Shift+SpaceCtrl+Shift+Space or Ctrl+Alt+SlashCtrl+Shift+SpaceShift+Alt+SpaceCtrl+Shift+Space or Ctrl+Shift+Back SlashShift+Alt+SpaceControl Shift SpaceControl Shift SpaceShift Alt Space once more.

    Thus you can complete, for example:

    • Chained expressions.
    • Collections, lists and arrays. IntelliJ IDEA searches for the symbols with the same component type and suggest to convert them.
    • 12.0+Static method calls or constant references. IntelliJ IDEA scans for the static methods and fields, but suggests only the ones with the type suitable in the current context.

See Also

Procedures:

External Links:

Web Resources: