Skip to content

Commit 7c2cc3c

Browse files
authored
Merge pull request #18 from ProvableHQ/josh/zed-client
feat: add Zed editor client
2 parents 2960b53 + f1a78db commit 7c2cc3c

21 files changed

Lines changed: 2262 additions & 10 deletions
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: build-zed-extension
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "packages/zed/**"
7+
- ".github/workflows/build-zed-extension.yml"
8+
push:
9+
branches: [master]
10+
paths:
11+
- "packages/zed/**"
12+
13+
jobs:
14+
build:
15+
# Linux is sufficient: validate.sh builds the wasm and runs the leo-lsp-smoke
16+
# LSP-wire assertion. It does NOT drive a headless Zed (Zed compiles +
17+
# component-encodes a dev extension itself, with no headless/CLI equivalent;
18+
# extension load is verified manually — see packages/zed/Developer.md).
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
- name: Install Node deps
26+
# Required: validate.sh invokes the workspace-private leo-lsp-smoke /
27+
# discover CLIs, which need node_modules (vscode-jsonrpc).
28+
run: npm ci
29+
- uses: dtolnay/rust-toolchain@stable
30+
with:
31+
targets: wasm32-wasip2
32+
- name: Build extension
33+
working-directory: packages/zed
34+
run: cargo build --release --target wasm32-wasip2
35+
- name: Build leo-lsp from ProvableHQ/leo
36+
uses: ./.github/actions/build-leo-lsp
37+
- name: Validate
38+
run: bash packages/zed/scripts/validate.sh

.github/workflows/watch-leo-tags.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,19 @@ jobs:
127127
if git diff --quiet -- \
128128
packages/vscode/generated-from-leo.json \
129129
packages/shared/syntaxes/leo.tmLanguage.json \
130-
packages/shared/syntaxes/prism-leo.js; then
130+
packages/shared/syntaxes/prism-leo.js \
131+
packages/zed/extension.toml \
132+
packages/zed/languages/leo; then
131133
echo "has_changes=false" >>"$GITHUB_OUTPUT"
132134
exit 0
133135
fi
134136
135137
git add \
136138
packages/vscode/generated-from-leo.json \
137139
packages/shared/syntaxes/leo.tmLanguage.json \
138-
packages/shared/syntaxes/prism-leo.js
140+
packages/shared/syntaxes/prism-leo.js \
141+
packages/zed/extension.toml \
142+
packages/zed/languages/leo
139143
git commit -m "chore: sync Leo syntax from $TARGET_REF"
140144
git push --force-with-lease origin "$SYNC_BRANCH"
141145
@@ -169,6 +173,7 @@ jobs:
169173
- regenerated \`packages/shared/syntaxes/leo.tmLanguage.json\`
170174
- regenerated \`packages/shared/syntaxes/prism-leo.js\`
171175
- updated \`packages/vscode/generated-from-leo.json\`
176+
- re-pinned \`packages/zed/extension.toml\` grammar \`rev\` and synced \`packages/zed/languages/leo/*.scm\`
172177
173178
## Source
174179

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,11 @@ dist
140140
vite.config.js.timestamp-*
141141
vite.config.ts.timestamp-*
142142
packages/vscode/vendor/
143+
144+
# Rust build output (Zed extension, packages/zed)
145+
target/
146+
**/target/
147+
148+
# Zed dev-extension build artifacts (written into packages/zed/ on `install dev extension`)
149+
packages/zed/extension.wasm
150+
packages/zed/grammars/

README.md

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,34 @@
22

33
IDE integrations and language server clients for the Leo programming language.
44

5-
This workspace is intended to be the long-term home for Leo editor clients and
6-
adjacent tooling: VS Code today, and eventually other integrations such as Zed,
7-
Vim, Cursor, Sublime Text, MCP-facing tooling, and shared client infrastructure.
5+
This workspace is the long-term home for Leo editor clients and adjacent
6+
tooling. All clients share `leo-lsp` (the Leo language server) and the
7+
tree-sitter grammar + queries regenerated from upstream `ProvableHQ/leo`.
8+
9+
## Supported clients
10+
11+
| Client | Integration | Package / distribution |
12+
|--------|-------------|------------------------|
13+
| **VS Code** | Native extension | `packages/vscode` → VS Code Marketplace (`aleohq.leo-extension`) |
14+
| **Cursor** | Runs the VS Code extension | `packages/vscode` → Open VSX |
15+
| **Antigravity** | Runs the VS Code extension | `packages/vscode` → Open VSX |
16+
| **Zed** | Native extension | `packages/zed` → Zed extensions registry |
17+
18+
Cursor and Antigravity are VS Code–compatible editors: they install the same
19+
extension from `packages/vscode` (via Open VSX) and each has its own validation
20+
harness. Zed is a separate, native Rust extension. Further integrations (Sublime
21+
Text, JetBrains, MCP-facing tooling) are planned.
822

923
## Workspace Layout
1024

1125
- `packages/vscode`: The Leo VS Code extension that will continue publishing to
12-
the existing `aleohq.leo-extension` marketplace listing.
26+
the existing `aleohq.leo-extension` marketplace listing. Also the extension
27+
installed by Cursor and Antigravity (via Open VSX).
28+
- `packages/zed`: The native Leo extension for the Zed editor (Rust →
29+
`wasm32-wasip2`). Registers the `leo` language, pins the tree-sitter grammar
30+
to a `ProvableHQ/leo` release commit, and launches `leo-lsp` over stdio. See
31+
`packages/zed/README.md` (install/usage) and `packages/zed/Developer.md`
32+
(build, validation, release).
1333
- `packages/shared`: Shared substrate consumed by every Leo editor client and
1434
by CI workflows. See `packages/shared/README.md` for the per-subdirectory
1535
index. Contains the canonical TextMate grammar (regenerated from
@@ -26,11 +46,14 @@ Vim, Cursor, Sublime Text, MCP-facing tooling, and shared client infrastructure.
2646

2747
## Current Focus
2848

29-
The current implementation work is centered on the VS Code extension:
49+
The VS Code extension (also serving Cursor and Antigravity) and the Zed
50+
extension are the shipping clients. Cross-cutting work:
3051

3152
- syntax artifacts generated from Leo's tree-sitter source in the main
32-
`ProvableHQ/leo` repo for both VS Code and Prism-based website consumers
33-
- a lean client-side extension scaffold
53+
`ProvableHQ/leo` repo, kept in lockstep across consumers (VS Code TextMate,
54+
Prism for the website, and the Zed tree-sitter queries) by one sync workflow
55+
- lean client-side extension scaffolds that defer real language features to
56+
`leo-lsp`
3457
- a clean migration path toward future Rust-based language tooling
3558

3659
## Where To Look
@@ -39,11 +62,15 @@ The current implementation work is centered on the VS Code extension:
3962
`packages/vscode/README.md`
4063
- VS Code developer and release workflow notes:
4164
`packages/vscode/Developer.md`
65+
- Zed user-facing extension README:
66+
`packages/zed/README.md`
67+
- Zed developer, build, and release notes:
68+
`packages/zed/Developer.md`
4269
- Repository contribution notes:
4370
`CONTRIBUTING.md`
4471
- Shared generated website syntax assets:
4572
`packages/shared/README.md`
46-
- VS Code tag-watching sync automation:
73+
- Leo tag-watching sync automation (TextMate, Prism, and Zed grammar/queries):
4774
`.github/workflows/watch-leo-tags.yml`
4875
- Downstream docs Prism sync automation:
4976
`.github/workflows/sync-prism-to-leo-docs.yml`
@@ -62,6 +89,17 @@ npm run build:vscode
6289
npm run package:vscode
6390
```
6491

92+
For the Zed extension:
93+
94+
```bash
95+
npm install # for the shared leo-lsp-smoke / discover CLIs
96+
npm run build:zed # cargo build --release --target wasm32-wasip2
97+
npm run validate:zed # builds the wasm + leo-lsp-smoke definition assertion
98+
```
99+
100+
To run it in Zed, use the command palette → **zed: install dev extension**
101+
select `packages/zed` (Zed compiles + loads it). See `packages/zed/Developer.md`.
102+
65103
The root workspace README intentionally stays lightweight. Package-specific
66104
details, sync behavior, and release flow documentation should live with the
67105
package they belong to.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
],
1111
"scripts": {
1212
"build:vscode": "npm run build --workspace leo-extension",
13+
"build:zed": "cd packages/zed && cargo build --release --target wasm32-wasip2",
1314
"check": "npm run typecheck --workspace leo-extension",
1415
"generate:prism": "node ./scripts/generate-prism-grammar.mjs --leo-repo ../leo --leo-ref HEAD",
1516
"generate:syntaxes": "node ./scripts/generate-syntax-artifacts.mjs --leo-repo ../leo --leo-ref HEAD",
@@ -23,6 +24,7 @@
2324
"validate:cursor": "npm run validate:cursor --workspace leo-extension",
2425
"validate:cursor:teardown": "node ./scripts/cursor/teardown.mjs",
2526
"validate:antigravity": "npm run validate:antigravity --workspace leo-extension",
27+
"validate:zed": "bash packages/zed/scripts/validate.sh",
2628
"test:prism": "node --test tests/prism-grammar.test.mjs"
2729
}
2830
}

packages/shared/identity.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ the handle is retained for continuity but the **display vendor** is
2323
`Provable Inc.` in every README, `LICENSE` header, and `description`
2424
metadata field.
2525

26+
**Documented exception — Zed package (`packages/zed`).** The Zed extension's
27+
`authors` field, in both `Cargo.toml` and `extension.toml`, uses the upstream
28+
Leo Rust crate string `The Leo Team <leo@provable.com>` (as in `leo-lsp` /
29+
`leo-compiler`) rather than the `Provable Inc.` vendor above. This is a
30+
deliberate choice so the Zed crate + manifest match the upstream `ProvableHQ/leo`
31+
metadata it is published alongside. The `Provable Inc.` display vendor still
32+
applies to every other client's README/description/license surfaces.
33+
2634
## Language
2735

2836
| Field | Value |

0 commit comments

Comments
 (0)