Build instructions

Prerequisites

Developing VS Code extensions requires Node.js. A supported version can be installed with nvm.

Build and run

To build and run the extension:

  1. Open this directory (vscode-plugins) in VS Code.

  2. Open the terminal window and run npm install.

  3. On the left side Run/Debug pane, click Run.

    This opens another VS Code instance with the extension installed.

Test

To test the extension:

  1. Run npm test.

Package the extension

  1. Open this directory (vscode-plugins) in VS Code:

    cd ~/vscode-plugins
    
  2. Remove any files that are not tracked by git and are not listed in .vscodeignore:

    Note: This ensures a clean build.

    git clean -xdf
    
  3. Do a clean npm install:

    Note: 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 is out of sync with package.json.

    npm ci
    
  4. Test the npm install:

    npm test
    
  5. Package the extension:

    npx vsce package --baseContentUrl https://fuchsia.googlesource.com/vscode-plugins/+/refs/heads/main/