This behavior is for version 1.20, which is currently the latest.
Summary
A rule declaration is included in the results when selecting Go To -> Declaration or Usages from the context-sensitive menu of a rule declaration. This behavior prevents IntelliJ from navigating from a declaration to a usage when there is only one usage.
Steps to reproduce
Find or create a rule with only a single usage.
Select Go To -> Declaration or Usages from the context-sensitive menu of the declaration.
Actual behavior
A popup containing two search results is displayed. The two search results are the declaration and the usage.
Expected behavior
Contrast this behavior with the behavior when performing the same steps on Java code.
The behavior on Java code is that IntelliJ navigates from the declaration to the usage.
Intended behavior?
The heading "Expected behavior" is referring to the behavior that I expected. I wonder though if the actual behavior is the behavior intended by the ANTLR plugin maintainers. In the jetbrains-plugin-sample repository, this javadoc comment says
we want defs to be included in "find usages."
I don't think definitions/declarations should be included in the list of usages, but I can understand if others think they should be included.
This behavior is for version 1.20, which is currently the latest.
Summary
A rule declaration is included in the results when selecting
Go To -> Declaration or Usages
from the context-sensitive menu of a rule declaration. This behavior prevents IntelliJ from navigating from a declaration to a usage when there is only one usage.Steps to reproduce
Go To -> Declaration or Usages
from the context-sensitive menu of the declaration.Actual behavior
A popup containing two search results is displayed. The two search results are the declaration and the usage.
Expected behavior
Contrast this behavior with the behavior when performing the same steps on Java code.
The behavior on Java code is that IntelliJ navigates from the declaration to the usage.
Intended behavior?
The heading "Expected behavior" is referring to the behavior that I expected. I wonder though if the actual behavior is the behavior intended by the ANTLR plugin maintainers. In the
jetbrains-plugin-sample
repository, this javadoc comment saysI don't think definitions/declarations should be included in the list of usages, but I can understand if others think they should be included.