Home > OS >  How to disable C# extension on VS Code changing the color?
How to disable C# extension on VS Code changing the color?

Time:03-12

After I installed and enabled enter image description here

but after I ENABLED the C# extension, it became

enter image description here

so I guess that it might mistakenly interprets the syntax.

CodePudding user response:

Probably the C# extension adds new enter image description here

If you really want to change colours, you can customize your theme in VS code by adding something like the following to your JSON configuration:

"workbench.colorCustomizations": {
    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": [
                    "comment.block.js",
                ],
                "settings": {
                    "foreground": "#FF0000",
                }
            },
        ]
    }
}

So what you would have to do:

  1. Disable the C# Extension
  2. Use the scope inspector to find out all color values that you would like to keep and write them down somewhere
  3. Enable the C# Extension again
  4. Use the scope inspector to find out all scopes of tokens which changed their color
  5. Add a textmate rule for each scope with the previous colour to your settings
  • Related