Building instructions

Prerequisites

VS Code extension development requires Node.js. Our development workflow has been tested with 1.17.9, but newer versions should work. Older versions may break.

You can install a recent copy of Node by any of the following

a. Downloading Node from its website and placing it on your PATH b. Downloading Node via nvm c. Downloading Node from CIPD and placing it on your PATH

Read about extensions, concepts and guides: Extension Anatomy.

Building

To run the extension:

  • Open this directory in VS Code
  • Open the terminal window and run npm install vsce
  • Click “Run”. This will open another instance with the extension installed.

Packaging the extension

  • cd to vscode-plugins (This directory).
  • git clean -xdf [^3] (WARNING: this will delete everything not tracked by git)
  • npm ci [^1]
  • npm test
  • npx vsce package --baseContentUrl https://fuchsia.googlesource.com/vscode-plugins/+/refs/heads/main/ [^2]

[^1]: npm ci is like npm install, except that it re-downloads a clean copy of the node_modules directory using package-lock.json and errors out if package-lock.json ii out of sync with package.json

[^2]: npx runs commands from npm packages without having to globally install them

[^3]: this cleans out any files that are not tracked by git, to ensure we have a clean build, in case we missed anything in our .vscodeignore

Adding feature flags

See the docs at the top of feature-flags.ts for more details.