Background
In IntelliJ IDEA, the hierarchy tool window can include various Java elements such as source code, jar libraries, and JDK libraries.
Some users may prefer to view only specific elements, such as Java source code while excluding jar libraries and JDK libraries.
Customizing the scope of the Hierarchy view allows such targeted filtering.
Question
How to configure IntelliJ IDEA to make the hierarchy tool window include only Java source code and exclude jar and JDK libraries?
Answer
-
Understand Scopes in IntelliJ IDEA:
Scopes allow you to define subsets of your project’s objects, such as files, methods, or classes, based on specific criteria. These custom scopes can also be applied to various tool windows, including the Hierarchy tool window, to filter the displayed elements. -
Configure a Custom Scope:
-
Navigate to Preferences | Appearance & Behavior | Scopes.
-
In the Scopes panel, define a new scope by specifying rules to include the folders/files you need and exclude those you don't (e.g., jar libraries or JDK).
-
Name the scope appropriately for easy identification in different tool windows.
-
-
Apply the Custom Scope to the Hierarchy Tool Window:
-
Open the Hierarchy tool window while standing on a relevant method/class.
-
Locate the scope dropdown or filter button within the tool window.
-
Select your newly created custom scope from the options.
-
For further details on using and configuring scopes, read the official guide.
Comments
0 comments
Please sign in to leave a comment.