Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode - Change color of typescript function decorator

Is there a way to change the syntax highlight color of decorators in VSCode? Given the small example :

     @HostListener('mouseenter')
     onMouseEnter() {}

Both @HostListener and onMouseEnter are highlighted in the same color. I want to change that. So far I tried messing with "editor.tokenColorCustomizations": { "functions" : "SomeColorHere"}}, but this changes both the decorator and the function declaration.

like image 625
Eduardo Almeida Avatar asked May 28 '18 13:05

Eduardo Almeida


1 Answers

Here is my config to use TODO highlight as Mark advised, i excluded require and import to avoid interfering with js and stylus

quick note on the screenshot: the default italic style is from here, and the inline property is from here

"todohighlight.isEnable": true,
"todohighlight.isCaseSensitive": true,
"todohighlight.keywordsPattern": "@(?!require|import)[\\w-_.]*",
"todohighlight.defaultStyle": {
    "color": "#1E88E5",
    "backgroundColor": "0",
    "fontWeight": "bold"
},
"todohighlight.include": [
    "**/*.js",
    "**/*.ts",
    "**/*.vue",
],
"todohighlight.exclude": [
    "**/node_modules/**",
    "**/bower_components/**",
    "**/dist/**",
    "**/build/**",
    "**/.vscode/**",
    "**/.github/**",
    "**/_output/**",
    "**/*.min.*",
    "**/*.map",
    "**/.next/**"
],
"todohighlight.maxFilesForSearch": 5120,
like image 109
Sceat Avatar answered Oct 06 '22 11:10

Sceat