I’ve been trying to customize a color theme in VS Code and fiddled around with some properties a little bit. I found out that some properties are theme-dependant.
I’ve been sitting on attempting to customnize function calls as I found a theme that is nearly perfect but I am having trouble distingushing the calls from variables. I’ve tried something like this:
//color customization
"editor.tokenColorCustomizations": {
"[Night Owl Black (No Italics)]": [
{
"textMateRules": {
"scope": "meta.function-call.Python",
"settings": {
"foreground": "#60c0e0",
// "fontStyle": ""
},
},
},
],
},
However, this doesn’t seem to do anything. I also tried a different textmate token meta.function-call.generic.python
with no luck
I’ve tried using semantic token highlighting but enabling them just turns syntax highlighting into a rainbow barf.
2
Answers
If you want to modify the color when calling a function, you can use the following settings:
With semantic highlighting, you can do this:
See also the
editor.semanticHighlighting.enabled
setting, theenabled
property ofeditor.semanticTokenColorCustomizations
settings, and https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide.With token colourization (and semantic highlighting enabled), the following two work pretty well (but not when semantic highlighting is disabled):
With semantic highlighting disabled, it seems trickier, having to write more scopes. I’m not sure if I’ve covered everything here:
Note that the above will also colour the parentheses and anything in them that don’t have their own token colourization rules.
If you want to disable semantic highlighting for a particular language mode, you can do this: