admin管理员组

文章数量:1356694

Im trying to change color for my vsc. Now when i check developer: inspect editor tokens and scopes the instance of new class it shows me only:

(.png

but switching to dark theme i got semantic token type instead of textmate scope
.png

JSON with my theme have

"semanticTokenColors": {
        "class": {
            "foreground": "#4EC9B0"
        }
    },

also in

    "tokenColors": [
        {
            "name": "Types declaration and references",
            "scope": [
                "support.class",
                "support.type",
                "entity.name.type",
                "entity.name.namespace",
                "entity.other.attribute",
                "entity.name.scope-resolution",
                "entity.name.class",
                "storage.type.numeric.go",
                "storage.type.byte.go",
                "storage.type.boolean.go",
                "storage.type.string.go",
                "storage.type.uintptr.go",
                "storage.type.error.go",
                "storage.type.rune.go",
                "storage.type.cs",
                "storage.type.generic.cs",
                "storage.type.modifier.cs",
                "storage.type.variable.cs",
                "storage.type.annotation.java",
                "storage.type.generic.java",
                "storage.type.java",
                "storage.type.object.array.java",
                "storage.type.primitive.array.java",
                "storage.type.primitive.java",
                "storage.type.token.java",
                "storage.type.groovy",
                "storage.type.annotation.groovy",
                "storage.type.parameters.groovy",
                "storage.type.generic.groovy",
                "storage.type.object.array.groovy",
                "storage.type.primitive.array.groovy",
                "storage.type.primitive.groovy"
            ],
            "settings": {
                "foreground": "#4EC9B0"
            }
        },

but this still doesn't work. What should I do in order to get my theme treat new ClassName as semantic token type ?

Tried to change values in my json theme.

In order to reproduce install my theme:
.solracss-theme
Then create any class and create new object of this class in ts.


class Test {
  constructor() {}
}
 const test = new Test();

Then switch to deafault theme (Dark +) in vsc.
Run ctrl+shit+p type: inspect editor tokens and scopes and click on class name Test()

You should see this:
enter image description here

Then switch to my theme, repeat inspect..., and you will get:
enter image description here

How can I set on my theme that object will have class color assigned to semantic token type instead of textmate -> function as I got now.

本文标签: typescriptVSC color theme customization for new class instances in TSStack Overflow