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

Highlighting prefixed element is offset #56981

Closed
FMorschel opened this issue Oct 29, 2024 · 3 comments
Closed

Highlighting prefixed element is offset #56981

FMorschel opened this issue Oct 29, 2024 · 3 comments
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@FMorschel
Copy link
Contributor

Repro:

other.dart:

class MyClassName {}

main.dart

import 'other.dart' as i show MyClassName;

void f1([i.MyClassName? c]) {}

Now when you place the cursor over MyClassName it does highlight every reference to it but when you have the prefix it is offset/shorter (I'm unsure if you'd like to highlight the full i.MyClassName or only MyClassName):

image


CC: @DanTup

@FMorschel FMorschel changed the title Highlighting prefixed elemant is offset Highlighting prefixed element is offset Oct 29, 2024
@dart-github-bot
Copy link
Collaborator

Summary: The issue reports that when highlighting a prefixed element (i.MyClassName) in Dart code, the highlighting is offset and doesn't cover the entire prefixed name. The user is unsure whether the highlighting should include the prefix or just the element name.

@dart-github-bot dart-github-bot added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Oct 29, 2024
@bwilkerson
Copy link
Member

I believe that it should highlight just the name, and not the prefix. In other words, the bug is related to the computation of the offset, not the computation of the length.

@lrhn lrhn removed the triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. label Oct 29, 2024
@DanTup
Copy link
Collaborator

DanTup commented Oct 30, 2024

https://dart-review.googlesource.com/c/sdk/+/392580

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

5 participants