Reputation: 3622
I'm trying to figure out how to change object property colors in JS files in VS Code. For example:
var vehicle = {
type: "Fiat",
model: "500",
color: "white"
};
How would I set the color for "type, model and color" properties?
I was thinking this would work in settings.json, but it does not:
"editor.tokenColorCustomizations": {
"functions": {
"fontStyle": ""
},
"[TommyTachas]": {
"comments": "#db33a3",
"textMateRules": [
{
"scope": "support.type.property-name.js",
"settings": {
"foreground": "#ff0000"
}
}
]
}
}
Upvotes: 0
Views: 1695
Reputation: 21
Try it
"editor.semanticTokenColorCustomizations": {
"[your current theme]": {
"rules": {
"property": "#AE81FF"
}
}
Upvotes: 2
Reputation: 9
In your case if you want to change the var color it'll be "storage.type.js"
The following link has the information you are look for.
https://github.com/microsoft/vscode/issues/76308?msclkid=bfff79bec58d11eca167869d42275429
Upvotes: -1
Reputation: 28663
The scope to use is variable.other.property.js
"editor.tokenColorCustomizations": {
"textMateRules": [
{ "scope":"variable.other.property.js",
"settings": {"foreground": "#00ff00"}
}
]
}
Upvotes: 3