You can set up a development environment for debugging the extension during extension development.
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.
To run the tests locally, open the Debug viewlet (
Launch Tests, then hit run (
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
Extensions: Install from VSIX..., choose the vsix file generated in the previous step
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