Visual Studio Code support for TinyGo
This is a simple extension to add TinyGo support to Visual Studio Code.
Right now the only feature this extension supports is setting the right environment variables in the
.vscode/settings.json of your workspace. For example, it may set the following configuration to work with the BBC micro:bit:
To use it, click on the
TinyGo status bar element at the bottom of the screen and select a target. Alternatively, you could open the command palette and search for
- It is probably necessary to reload the window once you've set a new TinyGo target. You will be prompted for this if it's necessary.
- If the Go extension asks you to rebuild tools because the
GOROOT changed, don't do that. It will result in errors and not do what you expect. This is something that should be improved in a future version.
This extension depends on the following:
For easy development, you can modify the package.json file a bit:
- "main": "./dist/extension.js",
+ "main": "./out/extension.js",
There is probably a better way, but this works.
To create an extension as a package, run the following command:
This creates a new
vscode-tinygo-<version>.vsix file that you can install directly in VS Code.