-
Notifications
You must be signed in to change notification settings - Fork 2
Getting Started
Go to https://code.visualstudio.com/api/get-started/your-first-extension
and copy paste command
npm install -g yo generator-code
We need nodeJs for it -g
means it installs globally.
Now do run yo code
and name the extension. And do everything as said in terminal. Set Webpack as Yes and NPM.
This will build the project
The main place we will write the code is in src/extensions.ts
to run the debugger press F5 to launch debugger and extension
yarn watch
will compile the typescript file in src to a js file is dist/ folder
Note: For me hadoop Yarn and NPM yarn conflicted. Good bye hadoop you will not be missed.
Now to execute file press F5
but before we can run that we need to go to launch.json
which contains all the scripts for running the extension go there and remove
"preLaunchTask": "${defaultBuildTask}"
Now press F5
This will open the extension enabled vscode. Now if we type cmd + shift + p
it invokes the vscode command prompt window where we can run the command. If we type hello_world it will run the hello_world application. Now if we go to extension.ts and change anything. We need to reload the host using cmd + r
and if we run helloworld the change will be reflected.
the task.json
we will keep in empty we will run the yarn manually so file will be like this
{
"version": "2.0.0",
"tasks": [
]
}