Skip to content

feat: add a Zed extension - #1

Merged
MRocholl merged 1 commit into
mainfrom
feat/zed-extension
Sep 28, 2026
Merged

MRocholl merged 1 commit into
mainfrom
feat/zed-extension

Conversation

@jkoenig134

Copy link
Copy Markdown
Collaborator

What

A Zed extension in zed/, plus the one server change it needs to work well.

  • zed/: registers lat-lsp for Markdown, TypeScript/TSX, JavaScript, Python, Rust, Go, Shell, YAML, Lua, Dart, TOML, SQL, Terraform/HCL and Astro. It starts the first server it finds:

    1. the lsp.lat-lsp.binary setting,
    2. a lat-lsp on the worktree's PATH,
    3. otherwise an npm install of the exact server version in zed/Cargo.toml, run with Zed's own Node (the same "no config" setup as the VS Code extension).

    The server gets the user's shell environment either way, so it finds rg.

  • Server: registers a **/lat.md/**/*.md workspace/didChangeWatchedFiles watcher in onInitialized when the client supports dynamic registration. Zed extensions can't set up watchers themselves, so without this a git switch never reached the server. Neovim gets the same fix.

  • VS Code: drops the client-side synchronize.fileEvents watcher, since the server now registers one and the client would otherwise watch the same files twice.

  • CI: a zed job runs cargo fmt --check, clippy and a wasm32-wasip2 build. It also fails when zed/extension.toml / zed/Cargo.toml disagree with package.json, because the extension installs exactly that server version.

  • README: Zed install section, known limitation, updated release checklist.

Installing

It's not in the Zed registry yet. To install from a clone, run zed: install dev extension and pick zed/. Zed needs Rust installed through rustup. Listing it in the registry needs a follow-up PR to zed-industries/extensions.

Known limitation

Zed may send go-to-definition only to a language's primary server. In lat.md/ files everything works. In source files, jumping from a // @lat: annotation may come back empty unless lat-lsp is listed first in language_servers. This is documented in the README. It hasn't been checked in a running Zed yet.

Testing

  • npm run typecheck, npm test: 61/61 pass. There are two new tests: one checks the watcher is registered when the client supports dynamic registration, the other that nothing is registered when it doesn't. The first one fails against the old server.
  • cargo fmt --check, cargo clippy -D warnings, cargo build --release --target wasm32-wasip2: clean.
  • Not done: a manual run inside Zed. Also check VS Code still reindexes after an outside lat.md/ edit once it's on the new server.

Release note

This PR doesn't bump versions. Until the next release, the extensions install server 0.1.3, which doesn't register the watcher. For VS Code that means the removed client watcher only comes back once the extension and server ship together at the next version, which the normal release flow already does. Don't hand-publish the VS Code extension from this commit without bumping.

🤖 Generated with Claude Code

https://claude.ai/code/session_016cnR4eiZYCMuGyyasRG3ZP

zed/ registers lat-lsp for the languages that carry [[refs]] and @lat:
annotations. It starts the lsp.lat-lsp.binary setting, a lat-lsp on PATH,
or else npm-installs the server version it was released with and runs it
with Zed's Node.

Zed extensions cannot watch files themselves, so the server now registers
its own **/lat.md/**/*.md watcher when the client supports dynamic
registration. The VS Code extension drops its client-side watcher, which
would otherwise duplicate it.

CI builds the extension for wasm32-wasip2 and fails when the Zed manifests
disagree with package.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016cnR4eiZYCMuGyyasRG3ZP
@jkoenig134
jkoenig134 requested a review from MRocholl September 26, 2026 12:43
@MRocholl
MRocholl merged commit 2bf5fc1 into main Sep 28, 2026
2 checks passed
@jkoenig134
jkoenig134 deleted the feat/zed-extension branch October 15, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants