Zed extension for the Echo language.
- Syntax highlighting / folds / outline — tree-sitter grammar generated from
echo_syntaxviaxo tools grammar tree-sitter. - Language features —
xo lsp(diagnostics, hover, go-to-def, completion, rename, format, semantic tokens, …). Echo ships LSP in everyxobinary (no special Cargo feature).
This repo is both the Zed extension and the tree-sitter package root
(grammar.js, queries/, src/parser.c).
When you open an .echo file, the extension starts xo lsp in this order:
- Settings override —
lsp.xo.binary.path/arguments PATH—worktree.which("xo")(shell environment)- Known install layout —
~/.local/bin/xo,$XDG_DATA_HOME/xo/current/bin/xo,$XO_INSTALL_ROOT/bin/xo(fromscripts/install.sh) - GitHub release download — latest
modoterra/echorelease that has assets (stable first, else newest pre-release), cached under the extension work directory asxo-<version>/bin/xo
Status shows as “Checking for update” / “Downloading” while fetching.
Yes, when resolution falls through to GitHub:
| Situation | Behavior |
|---|---|
| Newer release published | Next language-server start downloads xo-<new-tag>/ and removes older xo-* dirs |
| Same version already cached | Reuses xo-<tag>/bin/xo (no re-download) |
xo on PATH / settings path |
Never hits GitHub — uses that binary (dev preferred) |
| Only pre-releases exist (current Echo) | Uses latest pre-release after stable lookup fails |
It tracks GitHub Releases, not unreleased main. To use a local LSP
(e.g. the reliability polish branch), put a built xo on PATH or set
lsp.xo.binary.path.
Assets are attached when a GitHub Release is published
(docs/ci.md,
docs/install.md).
| Platform | Asset name (current) | Archive layout |
|---|---|---|
| Linux x86_64 | xo-linux-x86_64.tar.gz |
bin/xo, bin/libecho_runtime.a, std/…, version |
| macOS arm64 | xo-macos-arm64.tar.gz |
same |
| Windows x86_64 | xo-windows-x86_64.tar.gz |
bin/xo.exe, … |
Also accepted if published later: Rust triples
(xo-x86_64-unknown-linux-gnu.tar.gz), version-prefixed names, or .zip on
Windows. The extension prefers bin/xo so co-located std/ resolves, and sets
XO_INSTALL_ROOT to the unpack root when using a downloaded tree.
cd ../echo
cargo build -p xo --release
# optional: install onto PATH / XDG
./scripts/install.sh install
# or just:
export PATH="$PWD/target/release:$PATH"Install this repo as a Zed dev extension (zed: install dev extension →
select zed-echo). LSP will pick up xo from PATH.
{
"lsp": {
"xo": {
"binary": {
"path": "/absolute/path/to/echo/target/debug/xo",
"arguments": ["lsp"]
}
}
}
}Leave xo off PATH and omit settings. Opening an .echo file downloads the
latest release asset for your OS (today: pre-release v0.0.1-alpha.*).
Grammar and queries/highlights.scm are derived from ../echo. Do not hand-edit
them as language authority.
cd ../echo
cargo build -p xo
./target/debug/xo tools grammar tree-sitter -o ../zed-echo
cd ../zed-echo
tree-sitter generate
tree-sitter build --wasm -o grammars/echo.wasm
cp queries/highlights.scm languages/echo/highlights.scm
# restore this README from git (generator may overwrite it)Rebuild the extension Wasm:
cargo build --target wasm32-wasip2 --release
cp target/wasm32-wasip2/release/zed_echo.wasm extension.wasm| Path | Role |
|---|---|
extension.toml |
Extension + language server + grammar registration |
src/lib.rs |
Resolves / downloads xo for LSP |
languages/echo/ |
Zed language config, highlights, folds, outline |
grammar.js / src/parser.c |
Generated tree-sitter grammar |
queries/highlights.scm |
Tree-sitter package highlights (source for Zed copy) |
grammars/echo.wasm |
Compiled grammar (for local packaging) |
- Comments are
;to EOL (not//). - Statement leaders are single glyphs (
$,~,?,|, …); see Echodocs/syntax.md. - Tree-sitter is a structural basemap. Prefer
xo lspsemantic tokens for bind/use fidelity. - Grammar fetch:
extension.tomlpoints atmodoterra/echo/grammars/tree-sitter-echo(public git URL + commit pin). Do not commit machine-localfile:///…paths.
Use common sense and decency. There is no formal code of conduct. We reserve the right to moderate this community to the extent of the law and the policy of the host. Write community@modoterra.xyz if you need us.