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

Invalid syntax highlightning for methods named "get" or "set" #2748

Closed
kinex opened this issue Aug 27, 2020 · 3 comments
Closed

Invalid syntax highlightning for methods named "get" or "set" #2748

kinex opened this issue Aug 27, 2020 · 3 comments
Labels
in editor Relates to code editing or language features is bug
Milestone

Comments

@kinex
Copy link

kinex commented Aug 27, 2020

The built-in identifiers get and set are blue when used in property declarations.

The problem is that they are blue also if they are used as normal method names, The expected behavior is that they have the same color as other normal methods.

This cosmetic issue is now more visible as the latest official Firestore plugin introduced renamed methods Query.get() and DocumentReference.set(). Also other popular plugin get_it uses a method named get.

@DanTup
Copy link
Member

DanTup commented Aug 27, 2020

This is a limitation of how we currently do syntax highlighting. The plan is to switch to proper semantic highlighting as part of the LSP migration. There's an issue open about this (which by coincidence I was just working on!) at #2202

It's not complete yet (the LSP spec has not been finalised), but I just tested with get and set and they are coloured the same as methods when they're methods, and keywords when they're keywords:

Screenshot 2020-08-27 at 15 34 30

I'll close this as a dupe, but you can subscribe to #2202 for updates on when it ships (though it will require both a Dart-Code and an SDK update since the LSP server lives in the SDK).

Thanks!

@DanTup DanTup added in editor Relates to code editing or language features is bug labels Aug 27, 2020
@DanTup DanTup added this to the v3.15.0 milestone Aug 27, 2020
@DanTup DanTup closed this as completed Aug 27, 2020
@DanTup DanTup added duplicate and removed in editor Relates to code editing or language features is bug labels Aug 27, 2020
@DanTup DanTup removed this from the v3.15.0 milestone Aug 27, 2020
@DanTup DanTup added this to the v3.18.0 milestone Nov 25, 2020
@DanTup DanTup added in editor Relates to code editing or language features is bug and removed duplicate labels Nov 25, 2020
@DanTup DanTup reopened this Nov 25, 2020
@DanTup
Copy link
Member

DanTup commented Dec 15, 2020

Fixed by dart-lang/sdk@cb2ede5.

In order to get the fix you'll need Dart-Code v3.18.0 (a preview release should be available later today/tomorrow), be using LSP Preview, and have a Dart SDK from after yesterday (the most recent nightly works, and of course the next releases of Dart/Flutter SDKs will include this).

semantic_tokens

@DanTup DanTup closed this as completed Dec 15, 2020
@DanTup
Copy link
Member

DanTup commented Dec 22, 2020

Due to some last minute issues, support for LSP 3.16 (which supports semantic tokens) won't be included in v3.18, but hopefully the next release after that.

@DanTup DanTup modified the milestones: v3.18.0, v3.19.0 Dec 22, 2020
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 is bug
Projects
None yet
Development

No branches or pull requests

2 participants