答案 0 :(得分:1)
将此添加到主题的settings.json中
"editor.semanticTokenColorCustomizations": {
"enabled": true, // enable semantic highlighting for all themes
"rules": {
"*.readonly": { "foreground": "#9cdcfe" },
"*.declaration": { "foreground": "#9cdcfe" }
}
}
答案 1 :(得分:0)
不确定如何仅对 .js 文件执行此操作,但此设置仅更改常量而不是所有声明。将此粘贴到您的 VsCode settings.json
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "variable.other.constant",
"settings": {
"foreground": "#f5f5f5"
}
}
]
},