是否可以在VS Code中为某些XML标签分配不同的颜色?

问题描述 投票:1回答:1

我有一个相当长的XML文档,我希望某些标签以某种颜色显示(例如,每个标签都应为红色)。在Visual Studio Code中是否有附加组件或一种方法可以做到这一点? ?

xml visual-studio-code vscode-settings color-scheme
1个回答
0
投票

使用命令面板中的scopes inspector,您将看到xml标记具有以下范围:

entity.name.tag.localname.xml
meta.tag.xml
text.xml

因此,将其放入您的设置将更改标签的颜色:

 "editor.tokenColorCustomizations": {

    "textMateRules": [

      {
        "scope": "entity.name.tag.localname.xml",
        "settings": {
          "foreground": "#f00",
          // "fontStyle": "underline"
        }
      }
  }
© www.soinside.com 2019 - 2024. All rights reserved.