"editor.semanticTokenColorCustomizations": {
"enabled": true,
"rules": {
"variable": {"bold": true}, // Bold all variables
"variable.local": {"bold": false}, // Un-bold local variables
"variable.defaultLibrary": {"bold": false}, // Un-bold defaultLibrary "variables" such as "console"
"property.declaration": {"bold": false}, // Un-bold object property value shorthand
}
},
不过,这似乎只突出显示已声明的全局变量(或在同一文件中声明的变量)。解决此问题的方法是添加editor.tokenColorCustomizations
,以获取语义突出显示未选择的任何变量。
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "variable.other.readwrite",
"settings": {
"fontStyle": "bold"
}
}
]
},