You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Find All References doesn't work with class declaration #4668
(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):
I think this might be the same as #4619. Does it only occur if you put the cursor at the end of the name, or have selected the whole class name (such as by double-clicking)? If you right click in the name without selecting it, does it work?
@DanTup OK, so just so that I understand -- you are able to replicate this now, hence the fix? Do I need to follow the repro+logging steps you requested a few comments ago, or are you confident you found and fixed it?
@lukehutch if the only issue you can reproduce is when the text cursor is just before the < (and this includes if you double-click the name to select it - in which case VS Code passes the end of the selection, which is just before the <) and it works fine if the cursor is in other parts of the name, then I'm confident my fix above is good.
If you see issues when the text cursor is in other parts of the name, then a log would be useful. Thanks!
Activity
DanTup commentedon Jul 31, 2023
I think this might be the same as #4619. Does it only occur if you put the cursor at the end of the name, or have selected the whole class name (such as by double-clicking)? If you right click in the name without selecting it, does it work?
If so, we can close this as a dupe of #4619 and it'll be fixed by https://dart-review.googlesource.com/c/sdk/+/316223.
Otherwise, can you capture a log when reproduce this, as I can only repro the issue above.
Could you try capturing debugging logs while reproducing this?
Thanks!
DanTup commentedon Jul 31, 2023
Actually, I think that fix only does Definition, not references - this might be a similar issue in different code.
DanTup commentedon Jul 31, 2023
Got a fix at https://dart-review.googlesource.com/c/sdk/+/317080
[analysis_server] Fix finding references for the offset between a typ…
lukehutch commentedon Jul 31, 2023
@DanTup OK, so just so that I understand -- you are able to replicate this now, hence the fix? Do I need to follow the repro+logging steps you requested a few comments ago, or are you confident you found and fixed it?
DanTup commentedon Jul 31, 2023
@lukehutch if the only issue you can reproduce is when the text cursor is just before the
<(and this includes if you double-click the name to select it - in which case VS Code passes the end of the selection, which is just before the<) and it works fine if the cursor is in other parts of the name, then I'm confident my fix above is good.If you see issues when the text cursor is in other parts of the name, then a log would be useful. Thanks!
lukehutch commentedon Jul 31, 2023
@DanTup Yes, it looks like the issue is only when the cursor is right before
<. I hadn't noticed this before. Thanks!lukehutch commentedon Jul 31, 2023
Sorry, not sure if I should have closed this before your patch was merged -- feel free to reopen if needed.
DanTup commentedon Jul 31, 2023
Cool, thanks for confirming. Yep, will keep this open as a reminder until it's merged. Thanks!
DanTup commentedon Aug 1, 2023
Actually, the fix had already been merged before this was closed 🙃 dart-lang/sdk@8abaa7b