【问题标题】:VS Code Set JavaScript Property colorVS Code 设置 JavaScript 属性颜色
【发布时间】:2020-12-09 19:30:09
【问题描述】:

我正在尝试弄清楚如何在 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"
                }
            }
        ]
    }
}

【问题讨论】:

    标签: javascript visual-studio-code vscode-settings


    【解决方案1】:

    使用范围是variable.other.property.js

      "editor.tokenColorCustomizations": {
        "textMateRules": [
          { "scope":"variable.other.property.js",
            "settings": {"foreground": "#00ff00"}
          }
        ]
      }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-04-20
      • 1970-01-01
      • 1970-01-01
      • 2019-07-20
      • 2020-10-03
      • 1970-01-01
      • 2015-03-22
      相关资源
      最近更新 更多