Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Building, Debugging and Sideloading the extension in Visual Studio Code
You can set up a development environment for debugging the extension during extension development.
Building and Debugging the extension
Ensure you have node installed.
Clone the repo, run
npm install and open a development instance of Code.
git clone https://github.com/Microsoft/vscode-go cd vscode-go npm install code .
Make sure the
window.openFoldersInNewWindow setting is not
You can now go to the Debug viewlet (
Ctrl+Shift+D) and select
Launch Extension then hit run (
This will open a new VS Code window which will have the title
[Extension Development Host]. In this window, open any folder with Go code.
In the original VS Code window, you can now add breakpoints which will be hit when you use any of the the plugin's features in the second window.
If you make edits in the extension
.ts files, just reload (
[Extension Development Host] instance of Code to load in the new extension code. The debugging instance will automatically reattach.
To debug the debugger, see the debugAdapter readme.
Running the tests
To run the tests locally, open the Debug viewlet (
Launch Tests, then hit run (
Sideloading the extension
After making changes to the extension, you might want to test it end to end instead of running it in debug mode. To do this, you can sideload the extension. This can be done by preparing the extension and loading it directly.
npm install -g vsceto make sure you have vsce installed globally
git clone https://github.com/Microsoft/vscode-goto clone the repo if you havent already done so
npm installto install dependencies if you havent already done so
vsce packageto build the package. This will generate a file with extension
- Run the command
Extensions: Install from VSIX..., choose the vsix file generated in the previous step
Use the beta version of this extension
If you want to help with testing the next update to this extension or you want to use the latest features that arent released yet, its easy to do so. Please see Use the beta version of the Go extension