Creating a VS Code Extension
You need to have Node (npm and NodeJS) installed. Going through the Visual Studio Code API Documentation before trying this out also would be helpful.
First, you have to install Yeoman and VS Code Extension Generator with the command below:
npm install -g yo generator-code
Then create a file directory for your new VS Code Extension and run the below command to generate the basic files for a VS Code Extension.
Some questions will be prompted during the process and you will have to input the necessary answers.
A repository with some auto-generated files will be created inside the directory. Open the repo using VS Code. Now navigate to the “src/extension.ts” and check whether it has console.log saying “Hello World from <repoName>”.
Then select the “Run and Debug” tab on the left-hand side and it should have a “Run Extension” button on the top. If everything is right when you click on that it must open a new VS Code window, which runs the VS Code Extension you initiated.
Once the new window is opened press ‘Ctrl+Shift+P’ and it will open the commands tab. Type “Hello World” or select the command from the drop-down and it will give you a prompt that will confirm that your extension is working.
TaDaa! You have initiated developing your first VS Code Extension.