Welcome! We really appreciate that you'd like to contribute to Air, thanks in advance!
The release process of Air has some manual steps. One complication is that for each release of the CLI binary, we create a new release of the VS Code / OpenVSX extension as this is our primary way of distributing Air. The version numbers between the CLI binary and the VS Code / OpenVSX extension will end up being different.
When you want to cut a release of the Air binary and Air VS Code / OpenVSX extension:
-
Create a release branch
-
Polish
CHANGELOG.md
, bump the version and add a newDevelopment version
header (yep, right away -cargo dist
is smart enough to ignore this header). -
Polish
editors/code/CHANGELOG.md
, bump the version and add a newDevelopment version
header. -
In
crates/air/Cargo.toml
, bump the version. -
Run
cargo check
to syncCargo.lock
. -
In
editors/code/package.json
, bump the minor version to the next even number for standard releases, or to the next odd number for preview releases. -
Open a PR with these changes.
-
-
Manually run the release workflow
-
It runs on
workflow_dispatch
, and you must provide theRelease Tag
version to create. Always provide the same version that you used inCargo.toml
. Do not prefix the version with av
. -
The release workflow will:
-
Build the binaries and installer scripts.
-
Create and push a git tag for the version.
-
Create a GitHub Release attached to that git tag.
-
Attach the binaries and scripts to that GitHub Release as artifacts.
-
-
-
Manually run the extension release workflow
- It runs on
workflow_dispatch
, and automatically pulls in the latest release binary of Air from the binary release workflow above. It will release to both the VS Code marketplace and the OpenVSX marketplace.
- It runs on
-
Merge the release branch
- There is no need to bump to an intermediate "dev version" after a release.
It is rare to need to do a Zed extension release because that code is fairly static. It knows how to download the latest version of Air, so we only need to change something there if we alter the way the extension itself works.
For a new release:
-
Create a release branch in Air called
release-zed/x.y.z
-
Update the
version
ineditors/zed/Cargo.toml
. -
Update the
version
ineditors/zed/extension.toml
to the same version. -
Open a PR with these changes, and go ahead and squash merge the PR. Note the commit hash of the merged commit.
-
-
Fork the
zed-industries/extensions
repository if you haven't yet. -
Create a release branch in
zed-industries/extensions
calledupdate-air/x.y.z
-
Update the Air submodule in
extensions/
to point to the commit of the newly merged PR from the Air Zed extension release. This looks something like:# Move into the submodule so `git` commands work on the submodule cd extensions/air # Fetch latest changes to Air git fetch origin # Checkout the Air sha you want to pin Zed to git checkout <commit-sha> # Move back to top level cd ../.. # Commit the Air sha update git add extensions/air
-
Update the Air
version
inextensions.toml
. Double check that thisversion
matches theversion
set in the Air Zed extension. -
Do a PR to
zed-industries/extensions
with these changes.
-
If you have any questions about the process, refer to Zed's update guide.
-
Build the development version of the Air CLI with:
cargo build
This does not install the CLI, but instead builds it to
target/debug/air
(ortarget/debug/air.exe
on Windows). -
Install the development version of the VS Code or Positron extension:
# Install for Positron (cd editors/code && (rm -rf *.vsix || true) && npx @vscode/vsce package && positron --install-extension *.vsix) # Install for VS Code (cd editors/code && (rm -rf *.vsix || true) && npx @vscode/vsce package && code --install-extension *.vsix)
The CLI tools for Positron or VS Code need to be installed on your path using the command palette command
Shell Command: Install 'code'/'positron' command in PATH
. -
In your
settings.json
, setair.executablePath
to the full path to the debug Air CLI binary you created in step one. Then setair.executableStrategy
to"path"
and restart the extension. At this point you can now swap between"path"
and"bundled"
to turn the debug binary on and off.
Zed has a great guide on developing extensions if you are working on the development version of the Air Zed extension. Read that first.
To install the development version of the Air extension:
-
Run
zed: install dev extension
-
Select the
editors/zed
directory. This will install the development version of the Air extension. Anextension.wasm
file should be created in theeditors/zed
directory. This file is.gitignore
d.
To rebuild the extension, Zed has a shortcut process:
-
Run
zed: extensions
-
Find
Air
in the list -
Click
Rebuild
We use nextest for testing rather than a standard cargo test
, primarily because nextest runs each test in its own process rather than in its own thread. This is critical for us, as Air has global objects that can only be set up once per process (such as the global logger). Additionally, using one process per test means that it is impossible for one test to interfere with another (so you don't have to worry about test cleanup). Tests are still run in parallel, using multiple processes, and this ends up being quite fast and reliable.
Install the nextest cli tool using a prebuilt binary.
Run tests locally with just test
, which calls cargo nextest run
. Run insta snapshot tests in "update" mode with just test-insta
.
On CI we use the nextest profile found in .config/nextest.toml
.