Skip to content

Find All References doesn't work with class declaration #4668

@lukehutch

Description

@lukehutch

Describe the bug

Given this class

class ProfileItem<T> extends StatelessWidget {
  const ProfileItem({
    Key? key,
  }) : super(key: key);
}

(and assuming that the class is used throughout my project,) if I select ProfileItem on the first line and then right-click and choose "Find All References", nothing is found. If I select ProfileItem on the second line (in the constructor definition) and then right-click and choose "Find All References", dart-code is able to find numerous references to the class.

To Reproduce
As above.

Expected behavior

Any reference to ProfileItem should correctly find all references. The syntax highlighter does highlight both references when I click on one of them.

Please complete the following information:

  • Operating System and version: Linux
  • VS Code version: latest
  • Dart extension version: latest
  • Dart/Flutter SDK version: latest
  • Target device (if the issue relates to Flutter debugging):

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris bugrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions