Skip to content

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

Closed

Description

@kinex

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.

Activity

  1. DanTup commented on Aug 27, 2020

    @DanTup
    Member

    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!

  2. added this to the v3.15.0 milestone on Aug 27, 2020
  3. added and removed
    in editorRelates to code editing or language features
    on Aug 27, 2020
  4. removed this from the v3.15.0 milestone on Aug 27, 2020
  5. added this to the v3.18.0 milestone on Nov 25, 2020
  6. added
    in editorRelates to code editing or language features
    and removed on Nov 25, 2020
  7. reopened this on Nov 25, 2020
  8. DanTup commented on Dec 15, 2020

    @DanTup
    Member

    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

  9. DanTup commented on Dec 22, 2020

    @DanTup
    Member

    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.

  10. modified the milestones: v3.18.0, v3.19.0 on Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresis bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions