fix(zed-extension): auto-download platform-specific streamd binary #128
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "127_zed-extension-auto-download-binary"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes #127. The Zed extension's
language_server_commandpreviously returned a bare"streamd"command (or shelled out towsl streamd lspon Windows), assuming a binary was already reachable. Under Zed Remote Development, Zed resolves that command relative to the extension's private work directory, which was never populated, so the LSP failed withNo such file or directory.language_server_commandnow prefers an existingstreamdonPATH(Worktree::which), otherwise downloads the matching platform release asset (linux-x86_64/windows-x86_64) into the extension's own work directory, caches it by version-embedded filename, and returns an absolute path.set_language_server_installation_status/Result::Errinstead of a silent failure..exedirectly, and Remote Development (WSL/SSH) already executes the extension inside the remote host.flake.nix'smkZedExtensionnow stamps the realstreamdversion (read from the same rootCargo.tomlevery other package already uses) into both the compiled wasm (viaSTREAMD_VERSION, consumed withoption_env!) andextension.toml, fixing a previously hardcoded, never-bumpedversion = "0.0.1".No configurable path setting or checksum verification was added — scoped out during refinement (see the plan comment on #127);
Worktree::whichalready covers self-managed installs, and downloads come straight from this project's own Forgejo instance over HTTPS.Test plan
cargo test— 5 new unit tests forrelease_asset_name(Linux/Windows/macOS/unsupported-arch) passcargo clippy --all-targets -- -D warningscleancargo fmt --checkcleannix build .#zed-extension— confirmedextension.toml's version is patched to match rootCargo.toml(not0.0.1)stringson the builtextension.wasmconfirmsSTREAMD_VERSIONand both platform asset-name format strings are correctly baked innix build .#zed-extension-zip— producesstreamd-zed-extension-<version>.zipas beforenix flake check— all checks pass (clippy, fmt, test, pre-commit)streamdbecause no binary is installed #127