Skip to content

The Go to Declaration or Usages action is performed in several steps.

Direct Navigation

Direct navigation is the navigation from PsiElement to another PsiElement, such as navigation from break keyword to the end of a loop in Java, without showing any popups.

To provide PsiElement for direct navigation, implement DirectNavigationProvider and annotate your implementation with @ExtensionImpl.

Reference-Based Navigation

If there is no Direct navigation available under the caret, then the Consulo proceeds with reference-based navigation. In this step the Consulo resolves the PsiReference under the caret using the resolve() method to find the target PsiElement. If the reference resolves to multiple targets (via PsiPolyVariantReference.multiResolve()), then the IDE shows a navigation popup to ask the user to choose where to go.

See References and Resolve for details on implementing references.

Showing Usages

If there are no navigation targets available, then the Consulo starts finding usages of the target element obtained by resolving a reference.