Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go To -> Declaration or Usages from declaration should not include the declaration #629

Closed
TysonMN opened this issue Apr 16, 2023 · 0 comments
Labels
Milestone

Comments

@TysonMN
Copy link

TysonMN commented Apr 16, 2023

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

  1. Find or create a rule with only a single usage.
  2. Select Go To -> Declaration or Usages from the context-sensitive menu of the declaration.

Screenshot 2023-04-16 at 8 53 58 AM

Actual behavior

A popup containing two search results is displayed. The two search results are the declaration and the usage.

Screenshot 2023-04-16 at 8 54 14 AM

Expected behavior

Contrast this behavior with the behavior when performing the same steps on Java code.

Screenshot 2023-04-16 at 8 31 05 AM

The behavior on Java code is that IntelliJ navigates from the declaration to the usage.

Screenshot 2023-04-16 at 8 31 22 AM

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.

ris58h added a commit to ris58h/intellij-plugin-v4 that referenced this issue Jul 7, 2023
ris58h added a commit to ris58h/intellij-plugin-v4 that referenced this issue Jul 7, 2023
ris58h added a commit to ris58h/intellij-plugin-v4 that referenced this issue Jul 19, 2023
@bjansen bjansen added this to the 1.22 milestone Sep 14, 2023
bjansen added a commit that referenced this issue Sep 14, 2023
…-usages

Don't include declarations in usages (fixes #629).
@bjansen bjansen added the bug label Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants