'How to use tokenColorCustomizations VS Code text color changer in dart?
Solution 1:[1]
Dart uses Semantic Tokens so you need to customise the semantic token colours rather than textmate tokens. For example:
"editor.semanticTokenColorCustomizations": {
"rules": {
"keyword.void": {
"foreground": "#ffff99",
"fontStyle": "underline"
}
}
},
This will make the void keyword (keyword is the type, void is a modifier) yellow and underlined:
You can see which semantic token types/modifiers are applied to each item by using the Inspect Editor Tokens and Scopes command in VS Code:
To change the colour of a class name, you could use:
"editor.semanticTokenColorCustomizations": {
"rules": {
"class": {
"foreground": "#ff9999"
}
}
},
Which will look like this:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Danny Tuppeny |




