'VS Code Set JavaScript Property color
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"
}
}
]
}
}
Solution 1:[1]
The scope to use is variable.other.property.js
"editor.tokenColorCustomizations": {
"textMateRules": [
{ "scope":"variable.other.property.js",
"settings": {"foreground": "#00ff00"}
}
]
}
Solution 2:[2]
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
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 | rioV8 |
Solution 2 | Prath |