...

/

Extensions and Snippets

Extensions and Snippets

Learn how extensions and snippets are used in Visual Studio Code.

We'll cover the following...

Extensions

One of the most important features of VS Code is its extensions. Out of the box, VS Code supports common code editor features like syntax highlighting and Intellisense, etc. It understands the type of code you’re writing and adapts to that in many different ways. But it doesn’t understand all languages. For example, perhaps you’re working on an Azure Resource Manager (ARM) template. An ARM template is JSON. Lucky for you, VS Code understands JSON out of the box. If you open up a file with a JSON extension, VS Code assumes it’s a JSON file and applies all features it has accordingly. In the following screenshot, you can see a couple of these features.

JSON is just plain text after all. For VS Code to know when a section should be collapsible and what text to change colors, it must understand JSON’s structure. VS Code applies these features differently, depending on the type of file opened.

Even though an ARM template is created in JSON, theVS Code understands that JSON doesn’t mean VS Code understands ARM templates. An ARM template isn’t just JSON. It has functions and a specific structure and schema. VS Code doesn’t know that a particular JSON file needs to have $schema ...