A Zed editor extension for the Mojo programming language.
- Syntax highlighting for
.mojoand.🔥files - Code completion, diagnostics, and hover documentation via
mojo-lsp-server - Auto-indentation and bracket matching
- Code outline in the symbols panel (
fn,def,struct,class,trait) - Vim text object support
Install the Mojo SDK so that mojo-lsp-server is available.
The extension finds the LSP server automatically in this order:
- PATH — works if
mojo-lsp-serveris globally available - Pixi — detects
pixi.tomlin the project and uses.pixi/envs/default/bin/mojo-lsp-server - MODULAR_HOME — uses
$MODULAR_HOME/pkg/packages.modular.com_mojo/bin/mojo-lsp-server - Default — falls back to
~/.modular/pkg/packages.modular.com_mojo/bin/mojo-lsp-server
If none of these work, set the path manually in Zed settings (Cmd+,):
{
"lsp": {
"mojo-lsp-server": {
"binary": {
"path": "/path/to/mojo-lsp-server"
}
}
}
}If your project uses pixi:
pixi add maxThe extension will detect pixi.toml and use the pixi environment's mojo-lsp-server automatically.
- Rust toolchain
# One-time: install the wasm target
make setup
# Build the extension
make build
# Or build + see install instructions
make devThen in Zed: Cmd+Shift+P → zed: install dev extension → select this directory.
- Tree-sitter grammar: lsh/tree-sitter-mojo
- Reference: modular/vscode-mojo