# Source code hierarchy

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/go/2026.3/llms.txt).

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

![Building and navigating a call hierarchy](https://resources.jetbrains.com/help/img/idea/2026.3/ri_callHierarchy.animated.gif)

## Analyzing code hierarchies

* Type hierarchies show what interfaces are implemented by the type and what types implement the interface.

* Call hierarchies show callers or callees of a method or a function.

When [built](#call), a hierarchy can be immediately viewed and examined in the Hierarchy tool window. The caller and the callee hierarchies are displayed in [two
separate tabs](#ws_toggle_between_views): click ![the Caller Hierarchy toolbar button](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.hierarchy.supertypes.svg) to view callers and ![the Callee Hierarchy button](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.hierarchy.subtypes.svg) to view callees.

> **Tip:**
> By default, every new built hierarchy overwrites the contents of the current tab. You can [retain the current tab](#retain) and have the next hierarchy built in a new one.

Procedure: Build a type hierarchy

1. Select the desired type or interface   in the editor.

2. In the main menu, go to `Navigate | Type Hierarchy` or just press `Ctrl+H` (Windows), `⌃ H` (macOS), `⌃ H` (IntelliJ IDEA Classic (macOS)), `⌃ ⌥ H` (macOS System Shortcuts), `Ctrl+H` (XWin), `Ctrl+H` (GNOME), `Ctrl+H` (KDE), `Ctrl+H` (Emacs), `Ctrl+H` (Sublime Text), `Ctrl+H` (Sublime Text (macOS)), `Ctrl+H` (VSCode), `⌃ H` (VSCode (macOS)).

![Type hierarchy shown in the Hierarchy Tool Window](https://resources.jetbrains.com/help/img/idea/2026.3/go_type_hierarchy.png)

Different colors of elements stand for different scopes to which these files belong. For example, green by default is used for tests. For more information, refer to [Associate scopes with colors](configuring-scopes-and-file-colors.html#associate-file-color-with-a-scope).

Procedure: Build a call hierarchy

1. Open a file in the editor and place the caret at the declaration or usage of the desired method or a function.

2. In the main menu, go to `Navigate | Call Hierarchy` or press `Ctrl+Alt+H` (Windows), `⌃ ⌥ H` (macOS), `⌃ ⌥ H` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ H` (macOS System Shortcuts), `Ctrl+Alt+H` (XWin), `Ctrl+Alt+H` (GNOME), `Ctrl+Alt+H` (KDE), `Ctrl+Alt+H` (Emacs), `Ctrl+Alt+H` (Sublime Text), `⌃ ⌥ H` (Sublime Text (macOS)), `Alt+Shift+H` (VSCode), `⌥ ⇧ H` (VSCode (macOS)).

![Build a call hierarchy](https://resources.jetbrains.com/help/img/idea/2026.3/go_build_call_hierarchy.png)

Procedure: Retain a hierarchy tab

* In the Hierarchy tool window, click the Pin Tab button ![Pin button](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.pin.svg) on the toolbar.

## Viewing hierarchies

Procedure: Open the Hierarchy tool window

1. Make sure, you have already built hierarchies to show, see [Building hierarchies](#ws_build_hierarchy) above.

2. Select `View | Tool Windows | Hierarchy` from the main menu.

Procedure: Navigate between the tabs

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

Procedure: Switch between callers and callees

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

Click ![the Caller Hierarchy toolbar button](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.hierarchy.supertypes.svg) or ![the Callee Hierarchy button](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.hierarchy.subtypes.svg) to show caller methods or callee methods respectively.

## Hierarchy tool window buttons

| Item | Description | Available In |
| --- | --- | --- |
| ![the Caller Hierarchy toolbar button](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.hierarchy.supertypes.svg)  |  Depending on the hierarchy type:     * Type hierarchies: shows the hierarchy of each supertype of the current type.    * Call hierarchies: shows the callers of the selected method.       |  All hierarchies |
| ![the Callee Hierarchy button](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.hierarchy.subtypes.svg) |    Depending on the hierarchy type:       * Type hierarchies: shows all types that extend the selected type.    * Call hierarchies: shows the callees of the selected method.       |  All hierarchies |
| ![the Sort Alphabetically button](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.objectBrowser.sortAlphabetically.svg) | Sorts all elements within a tree alphabetically. | Type hierarchies |
| Scope |    Use this list to limit the scope of the current hierarchy:       * Project: traces usages of the method across the project.    * Test: traces usages of the method across the test types.    * All: traces usages of the method across the project and the libraries.    * This type: limits the scope to the current type.     In addition to the preconfigured scopes, you can define your own one. To define a scope, select Configure from the list and define the required scope in the [Scopes](configuring-scopes-and-file-colors.html) dialog.    | Call hierarchies |
| ![the Respecting interface calls button](https://resources.jetbrains.com/help/img/idea/2026.3/app.gutter.implementingMethod.svg) | Searches for calls of the selected method in all structures that implement this interface method. By default, you see a list of calls for the selected method only in the current structure. | Call hierarchies |
| ![the Refresh button](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.refresh.svg) | Shows all updated types or type structures. | All hierarchies |
| ![the Navigate with Single Click button](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.autoscrollToSource.svg) | Moves to a file and a section in a source code that corresponds to the selected node in the hierarchy tree. | All hierarchies |
| ![the Expand All button](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.expandAll.svg) | Expands all nodes. | All hierarchies |
| ![](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.expandAll.svg) | Expands all nodes of the hierarchy tree. | All hierarchies |
| ![the Pin button](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.pin.svg) | Locks the current tab from closing and reusing. Results of the next command are displayed in a new tab.  | All hierarchies |
| ![the Export to Text File](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.export.svg) | Exports a hierarchy into a text file. You can specify a location for this file. | All hierarchies |
| ![the Close button](https://resources.jetbrains.com/help/img/idea/2026.3/app.windows.closeActive.svg) | Closes the tool window. | All hierarchies |

