Skip to content

Different semantic token type for top-level declarations #3778

@whiplashoo

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?

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 enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions