FFIVE
2023-11-02 21:33:14
我試圖弄清楚如何在 VS Code 中更改 JS 文件中的對象屬性顏色。例如:var vehicle = { type: "Fiat", model: "500", color: "white"};如何設置“類型、型號和顏色”屬性的顏色?我以為這可以在 settings.json 中使用,但事實并非如此:"editor.tokenColorCustomizations": { "functions": { "fontStyle": "" }, "[TommyTachas]": { "comments": "#db33a3", "textMateRules": [ { "scope": "support.type.property-name.js", "settings": { "foreground": "#ff0000" } } ] }}
3 回答

慕標5832272
TA貢獻1966條經驗 獲得超4個贊
使用范圍是variable.other.property.js
"editor.tokenColorCustomizations": {
"textMateRules": [
{ "scope":"variable.other.property.js",
"settings": {"foreground": "#00ff00"}
}
]
}

幕布斯6054654
TA貢獻1876條經驗 獲得超7個贊
嘗試一下
"editor.semanticTokenColorCustomizations": {
"[your current theme]": {
"rules": {
"property": "#AE81FF"
}
}

慕桂英4014372
TA貢獻1871條經驗 獲得超13個贊
在您的情況下,如果您想更改 var 顏色,它將是“storage.type.js”
以下鏈接包含您要查找的信息。
https://github.com/microsoft/vscode/issues/76308?msclkid=bfff79bec58d11eca167869d42275429
添加回答
舉報
0/150
提交
取消