如何在 Visual Studio Code 中更改XML 屬性的顏色?
例如,如何為以下identifiant
屬性選擇另一種顏色:
以下是當前的顏色主題設定:
"editor.tokenColorCustomizations": {
"[Solarized Dark]": {
"keywords": "#f00"
},
"functions": "#f5896e",
"numbers": "#dfd51b",
"keywords": "#215c21",
"strings": "#67f7e3",
"variables": "#22FF88",
"comments": "#332244"
}
或更直觀
換句話說:是否有任何標記專門適用于“XML 屬性”?
uj5u.com熱心網友回復:
是的,使用Scopes
檢查器 - 呼叫命令Developer: Inspect Editor Tokens and Scopes
您將看到 xml 屬性名稱具有范圍entity.other.attribute-name.localname.xml
。因此,您可以將此 textmate 規則添加到您的editor.tokenColorCustomizations
設定中:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "entity.other.attribute-name.localname.xml",
"settings": {
"foreground": "#f3873f",
"fontStyle": "italic"
}
},
]
}
有關更多資訊,請參閱textmate 范圍。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/314006.html