Skip to content

Different semantic token type for top-level declarations #3778

Closed

Description

@whiplashoo

While developing a VS Code theme specifically for Dart files and trying to set styles for each semantic token type, I found that no distinction can be made between top-level declarations and instance (class-based) ones, since they both have the same token type (property.declaration):

Inspecting a top-level variable:

Screenshot 2022-01-13 at 10 47 56 PM

Inspecting an instance field:

Screenshot 2022-01-13 at 10 48 16 PM

This is why they are both colored the same.

This distinction is made, for example in IntelliJ themes, as can be seen here:

Screenshot 2022-01-13 at 10 49 58 PM

Is there any way to be able to have a different semantic token type for this? For example, adding a instance modifier for declarations, getters and setters that are defined inside a class?

Activity

  1. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Jan 13, 2022
  2. added this to the v3.34.0 milestone on Jan 17, 2022
  3. added
    in lsp/analysis serverSomething to be fixed in the Dart analysis server
    in editorRelates to code editing or language features
    on Jan 17, 2022
  4. DanTup commented on Jan 18, 2022

    @DanTup
    Member

    This is fixed by dart-lang/sdk@f0475f6 which adds an "instance" modifier to the instance items. Since the change is in the SDK, it'll show up in a future SDK release rather than a Dart-Code release directly.

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 featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions