IntelliJ Platform Plugin SDK Help

Go to Class and Go to Symbol

A custom language plugin can provide its items to be included in the lists shown when the user chooses the Navigate | Class or Navigate | Symbol action.

Provide implementations of ChooseByNameContributorEx interface (separate implementations need to be provided for Class and Symbol, respectively), and register them in the com.intellij.gotoClassContributor and com.intellij.gotoSymbolContributor extension points.

Each ChooseByNameContributorEx implementation must provide the following methods:

  • processNames(@NotNull Processor<? super String> processor, @NotNull GlobalSearchScope scope, @Nullable IdFilter filter)

    Feeds the processor with a complete list of names available in a specified scope, which the IDE will then filter according to the text typed by the user in the dialog. Using Indexing and PSI Stubs to obtain matching candidates is highly recommended to improve performance.

  • processElementsWithName(String name, Processor<? super NavigationItem> processor, FindSymbolParameters parameters)

    Feeds the processor with a list of NavigationItem instances (typically PsiElement) matching the given name and parameters. Processed NavigationItems specify the destinations to jump to when a specific item is selected from the list.

Example:

Last modified: 12 March 2024