Home > other >  Upper case color problem in Monokai Pro theme in VS code
Upper case color problem in Monokai Pro theme in VS code

Time:02-12

In the Monokai Pro color theme, some of my parameters starting with uppercase are shown in purple like the "DP_piping", as you can see in the following:

image

Is there any way to return it to the white color, like my other parameters?

I tried to switch to another theme, but either other themes are not comfortable for me or have the same problem.

CodePudding user response:

Any variable with more than one (1) capital before the _ is marked as constant.other.caps.python. I have no clue why they are special.

Trying to customize the color of only this TextMate scope depends on the theme. For some themes the customization is recognized but is strike through during lookup. On those themes you have to use the semantic scope. But they don't have a special color for constant.other.caps.python.

Monokai Pro does not have semantic scope for these variables but it defines a new color for constant.other.caps. By customizing this color for this theme you can remove the special color.

Add this to your settings.json (Global or Workspace)

  "editor.tokenColorCustomizations": {
    "[Monokai Pro]": {
      "textMateRules": [
        { "scope":"constant.other.caps",
          "settings": {"foreground": "#fcfcfa"}
        }
      ]
    }
  }
  • Related