简体   繁体   中英

how to make VSCode custom color ALL_CAPS variables in python?

I have the following code

在此处输入图片说明

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

在此处输入图片说明

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

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...)

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"
      }
    }
    ]
},

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM