Skip to content

Highligh other usages of a Record member when the cursor is on a Record member #61149

@rrousselGit

Description

@rrousselGit

When dealing with classes, clicking on a field highlights all the places where this specific field is used in the current file:

Image

It'd be nice if this worked with records too:

Image

As you can see, even though the cursor is on field, the other example.field later in the main isn't highlighted.


Ideally this highlight should highlight all usages of the field under cursor within the library, for all Records with a matching shape.

As such, given:

void main() {
  final example = (field: 42);
  example.field; < Cursor on field
}

void fn() {
  final example = (field: 42);
  example.field;
}

Then if the cursor is on example.field in main, the example.field in fn should also be highlighted, as the record shape maches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions