Jon Newton

March 25, 2021

VS Code Semantic Highlighting, or "Why are some vars green and some blue?!"

Yet again staring at VS Code and wondering why "yaml" is blue and "toml" is green.  Maybe toml is better?  VS Code is clearly communicating some information with the coloring but it wasn't totally apparent.

Screenshot_2021-03-24_20-24-43.png

Some googling led to the semantic token classification and a way to inspect said tokens:

Open the command palette, run "Developer: Inspect Editor Tokens and Scopes" and click around to see details on each token.
Screenshot_2021-03-24_20-31-22.png


You can lookup the semantic token type in the semantic token classification.


About Jon Newton

Pandemic programming and beyond! My Link Tree