A Zed extension that adds SudoLang language support: syntax highlighting, outline navigation, bracket matching, indentation, code injections, and — when sudolang-lsp is on $PATH — diagnostics and format-on-save.
- Source: https://github.com/dylan-gluck/zed-sudolang
- Grammar: https://github.com/dylan-gluck/tree-sitter-sudolang
- Language server: https://github.com/dylan-gluck/sudolang-lsp
Registers .sudo files as SudoLang. Markdown files (.md, .sudo.md, .mdc) are still handled by Zed's built-in Markdown extension; SudoLang code fences inside them (```sudo / ```SudoLang) are highlighted via Markdown's code-block injection once this extension is installed.
- Open the command palette (
cmd-shift-P). - Run
zed: extensions. - Search for SudoLang and click Install.
That's it — open any .sudo file to see highlighting, outline, and bracket matching.
To work against a local checkout of this repo:
- Clone this repository.
- In Zed, open the command palette and run
zed: install dev extension. - Select the cloned directory.
Zed builds the parser from the SHA pinned in extension.toml and installs the extension. Edits to local query files take effect after a restart.
- Syntax highlighting for interfaces, functions, constraints, commands, pipes, modifiers, strings, and section headings.
- Outline panel populated with interfaces, functions, constraints, commands, and
# headingmarkers. - Bracket pair matching for
{},[],(),"", and``. - Indent-on-newline after
{and[. - Vim-mode text objects for function / class / parameter / comment scopes.
- Diagnostics, formatting, hover, completion, and goto-definition via
sudolang-lsp(opt-in — see below).
The extension registers a language server named SudoLang LSP and
launches it on demand. It does not bundle a binary; install
sudolang-lsp yourself
and ensure it's on $PATH:
git clone https://github.com/dylan-gluck/sudolang-lsp
cd sudolang-lsp
cargo install --path .Once installed, Zed picks it up automatically when you open a .sudo
file. Enable format-on-save in your Zed settings to use the formatter:
{
"languages": {
"SudoLang": {
"format_on_save": "on"
}
}
}The server provides:
- Diagnostics — unbalanced braces, missing tokens, malformed
modifier lists (
:foo=bar;), broken${}interpolations. - Formatting — deterministic, AST-driven re-indent. Never reorders tokens or rewrites content; never touches the inside of multi-line strings or comments.
- Hover — Markdown blurbs for keywords, in-document identifiers
(function / interface / property / variable / parameter / constraint),
and
/commandinvocations. - Completion — keyword list plus every named declaration in the
current document. Trigger characters:
.,/,$. - Go to definition — jumps from an identifier or
/commandinvocation to its declaration in the same file.
If sudolang-lsp isn't on $PATH the extension fails the language-server
launch with an actionable error pointing here. The rest of the extension
(highlighting, outline, brackets) keeps working.
MIT.