2

In VS Code, I'd like to have one textmate scope (e.g. punctuation.definition.variable) reference another one (e.g. variable.other.readwrite.global) so that the first element always uses the second element's color. Is that possible?

I am not interested in creating my own theme because I want these changes to be dynamic, to stay in effect regardless of what theme is in use. Specifically, the Perl syntax definition for $foo separates the sigil (e.g. $) and the variable name (e.g. foo) into two separate elements, and I would like to treat them as one.

Joe Casadonte
  • 15,888
  • 11
  • 45
  • 57
  • What do you mean by element. Like an object, or arrays elements? Can you maybe write up a small snippet of code, in a code example, and reference which elements you want to have the same color? – JΛYDΞV Apr 01 '21 at 00:50

1 Answers1

1

In settings.json you can customize the editor workspace syntax highlighting with editor.tokenColorCustomizations and that will apply to every theme unless you specify it for some themes only.

Docs: https://code.visualstudio.com/docs/getstarted/themes#_editor-syntax-highlighting

Here you can find Docs for creating you own rule for syntax highlighting: https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide

NeNaD
  • 18,172
  • 8
  • 47
  • 89