Extension development
Tool setup
NodeJS is required to build the extension. You will also need to install vsce
:
npm install -g vsce
Common operations
-
Build and install:
-
Locally:
npm install && vsce package -o carbon.vsix && code --install-extension carbon.vsix
-
From a remote SSH host using VS Code Server:
npm install && vsce package -o carbon.vsix && ~/.vscode-server/cli/servers/Stable-*/server/bin/code-server --install-extension carbon.vsix
-
Using the UI:
npm install && vsce package -o carbon.vsix && realpath carbon.vsix
- This installs dependencies, builds the VSIX file, and prints the path.
- Open the command palette and select “Extensions: Install from VSIX…”.
- Enter the path printed by the above command.
-
-
Build and publish the release using the website:
npm install && vsce package -o carbon.vsix && realpath carbon.vsix
- Go to https://marketplace.visualstudio.com/manage/publishers/carbon-lang
- Next to the extension name, click the “…” and select “Update”.
- Select the
carbon.vsix
file.
Development
bazel build //toolchain
in project root.- Open utils/vscode folder in VS Code.
- Launch the extension using Run command (F5).
- In the opened window, open the carbon-lang repository as folder.
- Open a carbon file.
- Open code outline (Ctrl+Shift+O).
Debugging output
- Go to the “Output” panel.
- In the top right, there is a dropdown; select “Carbon Language Server”.
Updating dependencies
To update dependencies, run npm update
.