csch0
csch0

Reputation: 573

how to make VSCode custom color ALL_CAPS variables in python?

I have the following code

enter image description here

I would like to know if there is a way to customize a rule to only color CAPITALIZED variables like so:

enter image description here

Is it possible to somehow hack this in the settings? perhaps specify a list of variables we want highlighted with a #HEX color scheme.

Upvotes: 0

Views: 1476

Answers (2)

Ryan Yuan
Ryan Yuan

Reputation: 31

you could try this:

1.find out the textmate scopes by "Trigger the scope inspector from the Command Palette with the Developer: Inspect Editor Tokens and Scopes" 2.in your users setting replace the "scope" in below code and change the color

"editor.tokenColorCustomizations": {
     "textMateRules": [
      {
        "scope": "constant.other.caps.python",
        "settings": {
          "foreground": "#f5f5f5"
      }
    }
    ]
},

Upvotes: 0

Adam.Er8
Adam.Er8

Reputation: 13393

you could use TODO Highlight extension.

in the settings you can set a keywordsPattern or even just a list of specific keywords (as the name suggests, it originally intended to highlight TODO, but the settings allow you to fully customize it...)

Upvotes: 1

Related Questions