IntelliJ IDEA 2018.2 Help

Navigating to Declaration or Type Declaration of a Symbol

While editing your source code, you might need to navigate to the location where a particular named code reference (a symbol) has been first declared. The Navigate | Declaration command enables you to navigate to the initial declaration of a symbol from its usage. The Navigate | Type Declaration command enables you to navigate to the symbol's type declaration.

Important note

Navigate | Declaration/Type Declaration

  • Applies source code symbols, CSS, HTML, or XML tags and attributes, DTD and schema elements and attributes, and references in comments.

  • Does not apply to the primitive types.

To navigate to the symbol declaration

  1. Place the caret at the desired symbol in the editor.

  2. Do one of the following:
    • On the main menu, choose Navigate | Declaration.

    • Press Ctrl+B.

    • Click the middle mouse button.

    • Keeping Ctrl ( for macOS) pressed, hover your mouse pointer over the symbol. When the symbol turns into a hyperlink, its declaration will be displayed in the tooltip. Click the hyperlink without releasing the key to open the declaration in the editor.

      viewDeclaration.png

To navigate to the type declaration of a symbol

  1. Place the caret at the desired symbol in the editor.

  2. Do one of the following:
    • On the main menu, choose Navigate | Type Declaration.

    • Press Ctrl+Shift+B.

    • Keeping Ctrl+Shift (⌘+⇧ for macOS) pressed, hover your mouse pointer over the symbol. When the symbol turns into a hyperlink, its type declaration will be displayed in the tooltip. Click the hyperlink without releasing the keys to open the type declaration of the symbol in the editor.

      viewTypeDeclaration.png
Last modified: 20 November 2018

See Also

Procedures:

Concepts: