From the course: Visual Studio Code: Building an Extension

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Language definitions and themes

Language definitions and themes - Visual Studio Code Tutorial

From the course: Visual Studio Code: Building an Extension

Start my 1-month free trial

Language definitions and themes

- [Instructor] Editing the color theme files that we've been working with defines the style of code displayed in the editor. Now, that's what we call Syntax Highlighting. Now, the way this works is a bit complicated, so before we go too far, let's explore some of the magic behind Syntax Highlighting. In order to colorize code, Visual Studio Code has to understand how a language works, what its keywords are, and the structure of the language. It already understands several languages, including HTML, CSS, JavaScript, and even Markdown. But in order to know about others, it will need a little help. Now, for languages that it doesn't know, like perhaps UJS or Esvelt, you can create a language support extension. To figure out how to color things, Visual Studio Code looks through the existing code in the editor and identifies keyword called tokens. Now, this can be things like if, for, let statements or operators like the…

Contents