How to change color of Python classes VSCode

Viewed 742

I was looking here and I'm getting stumped on how to change the color of classes in VSCode. Currently, it looks like this:

from pathlib import Path

... But I'm trying to change the color of classes and haven't been successful so far. So far, I've tried this:

{
    "python.pythonPath": "/usr/local/bin/python3",
    "python.languageServer": "Pylance",
    "python.showStartPage": false,
    "workbench.colorCustomizations": {},
    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": "entity.name.class",
                "settings": {
                    "foreground": "#FF0000"
                }
            }
        ]
    }
}

Not sure what the value of scope should be to get this to work.

1 Answers

You can use Inspect editor tokens and scopes to get token name (look at the semantic token type)

enter image description here

Once you know token type set it in the settings

enter image description here

Related