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

'var' keyword is highlighted differently when used in for loop. #3932

Closed
safield opened this issue Apr 18, 2022 · 3 comments
Closed

'var' keyword is highlighted differently when used in for loop. #3932

safield opened this issue Apr 18, 2022 · 3 comments
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug
Milestone

Comments

@safield
Copy link

safield commented Apr 18, 2022

In the following listed example, the var keyword will be highlighted with two different colors.

In the first case it is given semantic token 'keyword' and the other textmate scope 'storage.type.primitive.dart'.

I think it would make sense for the var keyword to be the same color always.

    var list = [];
    for (var item in list) {
      ...
    }
@safield safield added the is bug label Apr 18, 2022
@DanTup DanTup added this to the v3.40.0 milestone Apr 19, 2022
@DanTup DanTup added in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server labels Apr 19, 2022
@DanTup
Copy link
Member

DanTup commented Apr 19, 2022

Good catch, thanks! Our of interest, what theme are you using? They're the same in my theme (Dark+) so this wasn't visible.

Got a fix at https://dart-review.googlesource.com/c/sdk/+/241600/. It's in the LSP server so it'll show up in a Dart/Flutter SDK release (after merging) rather than an update to the VS Code extension. The var outside of the loop was correct, and the one inside the for was missing its semantic token.

(I'll close this issue once the change is merged into the SDK).

@safield
Copy link
Author

safield commented Apr 19, 2022

I am using the ubuntu-monokai theme that can be found on my github page. It is based off the stock monokai, and most issues that symptomize on one, also symptomize on the other.

copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Apr 19, 2022
…or loop

Fixes Dart-Code/Dart-Code#3932.

Change-Id: Ie37dfb884761e0f23c05c9eb2ec5ea7f98f02a82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
@DanTup
Copy link
Member

DanTup commented Apr 19, 2022

Got it, thanks!

The fix for this has landed in dart-lang/sdk@84fbee0. It will appear in an upcoming SDK release.

I'll do some testing with the theme above, but if you notice any other inconsistencies before me/that I don't, please do file additional issues. Thanks!

@DanTup DanTup closed this as completed Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug
Projects
None yet
Development

No branches or pull requests

2 participants