From the course: Visual Studio Code: Building an Extension

Unlock the full course today

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

Using commands

Using commands - Visual Studio Code Tutorial

From the course: Visual Studio Code: Building an Extension

Start my 1-month free trial

Using commands

- [Instructor] We can create extensions that can control or expand what Visual Studio Code does. And we do that with JavaScript, so let's take a look at how we accomplish this. We need to add some metadata to execute commands, and usually that's done through the commands contribution, so in our package.json file we'll need to add a new section under contributions with some command information that's going to identify the command that will be triggered and then what appears when you are typing the command with the command pallet. You'll also need to specify the location of a Javascript file where this command will exist. Then we need to create an activation event definition. Now this is going to let Visual Studio Code look for an event that's going to trigger this command. We usually also add other to the categories when we create an extension like this. So let's take a look at how that's done and we'll also create some…

Contents