vs代码中特定变量的自定义着色

问题描述

如果插入到自定义方法中,我想突出显示 this 参数

// class Warlock
shout(this: Warlock){
        console.log(this.name)
    }

使用范围


language    typescript
standard token type Other
foreground  #A9B7C6
background  #2B2B2B
contrast ratio  6.92

semantic token type parameter
modifiers   declaration
foreground  variable.parameter
variable
{ "foreground": "#A9B7C6" }


textmate scopes 

variable.language.this.ts
variable.parameter.ts
Meta.parameters.ts
Meta.method.declaration.ts
Meta.class.ts
source.ts


我尝试将 variable.language.this.ts 插入 settings.JSON

 "editor.tokenColorCustomizations": {

      // unter Inspect Editor Tokens and Scopes
      // auswählen und auf item clicken

      "textMateRules": [



{
  "name": "Other","textmate scopes": "variable.language.this.ts","settings": {
      "foreground": "#DB6EA6",// special case
  }
},]


这给了我这个错误 Error :Property textmate scopes is not allowed

有没有办法改变这个特定变量的颜色?

解决方法

  "editor.tokenColorCustomizations": {
    "textMateRules": [
      { "scope":"variable.language.this.ts","settings": {"foreground": "#DB6EA6"}
      }
    ]
  },