Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio code VSCode-如何仅在javascript文件中更改常量的颜色?_Visual Studio Code - Fatal编程技术网

Visual studio code VSCode-如何仅在javascript文件中更改常量的颜色?

Visual studio code VSCode-如何仅在javascript文件中更改常量的颜色?,visual-studio-code,Visual Studio Code,由于最近对vscode进行了更新,我一辈子都找不到将其还原为旧颜色的设置。看起来所有的常量都变成了绿色,而规则变量保持不变。谢谢 将此添加到主题的settings.json中: "editor.semanticTokenColorCustomizations": { "enabled": true, // enable semantic highlighting for all themes "rules": { "*.readonly": { "foregrou

由于最近对vscode进行了更新,我一辈子都找不到将其还原为旧颜色的设置。看起来所有的常量都变成了绿色,而规则变量保持不变。谢谢


将此添加到主题的settings.json中:

"editor.semanticTokenColorCustomizations": {
    "enabled": true, // enable semantic highlighting for all themes
    "rules": {
        "*.readonly": { "foreground": "#9cdcfe" },
        "*.declaration": { "foreground": "#9cdcfe" }
    }
}

不确定如何仅对.js文件执行此操作,但此设置仅更改常量,而不是所有声明。将其粘贴到VsCode settings.json中


禁用语义突出显示设置。它在哪里?我在主题设置中找到的唯一内容是:editor.semanticHighlighting.enabled:false,editor.semanticTokenColorCustomizations:{enabled:false,//为所有主题启用语义高亮显示规则:{*.declaration:{前台:9cdcfe}}}这两个问题都没有解决。我想如果你找到了它,你应该发布一个答案来帮助其他人。这也会改变函数声明的颜色。让我退出2秒钟。
"editor.tokenColorCustomizations": {
        "textMateRules": [
          {
            "scope": "variable.other.constant",
            "settings": {
              "foreground": "#f5f5f5"
            }
          }
        ]
    },