WebStorm 2019.2 Help

Viewing Structure and Hierarchy of the Source Code

With WebStorm, you can examine the hierarchy of classes, methods, and calls and explore the structure of source files.

Building hierarchies

  • Type hierarchies show parent and children classes of a class.

  • Method hierarchies show classes where a method:

    • Is defined.

    • Is not defined.

    • Should be defined if the class is not abstract.

  • Call hierarchies show callers (supertypes) or callees (subtypes) of a method.

When built, a hierarchy can be immediately viewed and examined in the Hierarchy tool window. By default, every new built hierarchy overwrites the contents of the current tab. You can retain the current tab and have the next hierarchy built in a new one.

To build a hierarchy of types

  1. Select the desired class in the Project tool window or open it in the editor.

  2. From the main menu, select Navigate | Type Hierarchy or just press Ctrl+H.

To build a method hierarchy

  1. Open the file in the editor and place the caret at the declaration of the desired method. Alternatively, select the desired method in the Project view.

  2. From the main menu, select Navigate | Method Hierarchy or press Ctrl+Shift+H.

To build a hierarchy of method calls

  1. Open the file in the editor and place the caret at the declaration or usage of the desired method. Alternatively, select the desired method in the Project view.

  2. From the main menu, select Navigate | Call Hierarchy or press Ctrl+Alt+H.

To retain a hierarchy tab

In the Hierarchy tool window, click the Pin Tab button Pin button on the toolbar.

Viewing hierarchies

Open the Hierarchy tool window

  1. Make sure, you have already built hierarchies to show, see Building hierarchies above.

  2. Select View | Tool Windows | Hierarchy from the main menu or press N/A.

Navigate between the tabs of the Hierarchy tool window

  • Right-click the currently displayed tab and select Select Next Tab/Select Previous Tab from the context menu.

  • Press Alt+Right/Alt+Left.

  • Click the currently displayed tab, and select the next one to display from the list.

    Switching between pinned tabs  in the Hierarchy tool window

Toggle between views

With WebStorm, you can build and explore ascending or descending hierarchies, that is, callee or caller methods, parent or children classes and so on.

Click the Supertypes Hierarchy toolbar button or the Subtypes Hierarchy toolbar button to show caller methods or callee methods respectively.

Viewing the structure of a file

WebStorm can show you the structure of the file that is currently opened in the editor. You can examine the file structure in the Structure tool window Alt+7 or in the Structure popup Ctrl+F12.

  • Click The Show Fields button to show class fields.

  • Click The Show Inherited button to show inherited members.

Structure tool window
Last modified: 17 September 2019

See Also