CLion 2021.3 Help

Code hierarchies

In %product, you can build the following hierarchies:

  • Type hierarchy shows parent and children classes of a class.

    To build it, place the caret at the desired class in the editor and call Navigate | Type Hierarchy from the main menu (or press Ctrl+H).

    Type hierarchy
  • Call hierarchy shows callers (supertypes) or callees (subtypes) of a function.

    To build it, select the function the editor and call Navigate | Call Hierarchy from the main menu (or press Ctrl+Alt+H).

    Call hierarchy
  • Imports hierarchy shows where the current file is included and tracks all files included in the current file.

    To build it, open the file in the editor or select it in the Project view and call Navigate | Imports Hierarchy from the main menu (or press Alt+Shift+H).

    Import hierarchy

Once built, hierarchies can be brought up for close examination in the Hierarchy tool window (View | Tool Windows | Hierarchy).

You can retain the current tab and have the next hierarchy built in a new one.

Do one of the following:

  • Right-click the currently displayed tab, and choose Select Next Tab/Select Previous Tab on the context menu.

  • Use the Alt+Right and Alt+Left keyboard shortcuts.

  • Click the currently displayed tab, and choose the next tab to display.

    Toggle between views

    To show ascending or descending hierarchy (callee vs. caller methods, parent vs. children classes etc.), use the toolbar of the Hierarchy tool window:

    • Click Icons hierarchy supertypes to show supertypes.

    • Click Icons hierarchy subtypes to show subtypes.

      Last modified: 10 December 2021