-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Previously https://youtrack.jetbrains.com/issue/IDEA-367915 , previously dart-lang/sdk#53478.
Quoting the previous issue by @DanTup, adapted slightly:
Describe the bug
Highlighting of related tokens in the document does not seem to work for Dart object patterns.
Given the following code:
final MapEntry(:key) = const MapEntry<String, int>('a', 1);
print(key);
if (const MapEntry('a', 1) case MapEntry(:final key)) {
print(key);
}
Putting the cursor on "MapEntry" correctly highlights the other references:

However doing the same for "key" highlights nothing:

My understanding [i.e., @DanTup's] is that IntelliJ uses the navigation data from the Dart server for this, however if I Ctrl+Click on "key" on line 22, it navigates to where the cursor is on line 21 in the screenshot, so I believe this data is present.
To Reproduce
Steps to reproduce the behavior:
- Paste in the code above
- Put the cursor on an instance of "key"
Expected behavior
All related instances of "key" should be highlighted
Actual behavior
Nothing is highlighted
Screenshots
(see above)
Version information
- Dart plugin version: 242.24931
- IDE platform version: Android Studio Ladybug Feature Drop | 2024.2.2 Patch 1
- OS: Windows 11
- Flutter version: (unspecified in previous report, but I @gnprice am still seeing it with Flutter 3.39.0-0.1.pre, commit flutter/flutter@83382d1bb9)
Error messages / Logs / Other context
n/a