Skip to content

Repository files navigation

Rugo extension for Zed

Adds Rugo language support to Zed. Rugo is a Ruby-inspired language that compiles to a native binary via Go. Files with the .rugo extension are recognised.

What's included

  • Syntax highlighting via a local tree-sitter-rugo grammar (forked from tree-sitter-ruby v0.23.1 with Rugo-specific keyword tweaks).
  • Bracket matching, auto-indent, outline and text-object queries.
  • Snippets covering Rugo idioms: def, fn, struct, if/elsif, case, for, while, try/or, spawn, parallel, use/import/require, embed, rats, etc.
  • Runnable detection for rats and bench blocks.
  • Tasks for rugo run, rugo emit, rugo build, and rugo rats against the current file.

What's not included

  • No language server. Rugo does not ship an LSP, so completion, diagnostics, hover, and code actions are not provided.
  • No debug adapter. Rugo compiles to a native binary; debugging is done with standard Go/native tooling outside of Zed.

Repository layout

extension.toml             # extension metadata + local grammar reference
Cargo.toml                 # minimal Rust crate (no LSP plumbing)
src/rugo.rs                # tiny zed::Extension impl
languages/rugo/            # language config + tree-sitter queries + snippets
tree-sitter-rugo/          # vendored grammar source (source of truth)
grammars/rugo/             # generated at build time by scripts/setup-grammar.sh
scripts/setup-grammar.sh   # bootstraps grammars/rugo/ from tree-sitter-rugo/

The grammars/ directory is git-ignored. The grammar source is tracked under tree-sitter-rugo/ and materialised into grammars/rugo/ on demand.

Local development

  1. Clone this repository.
  2. Run ./scripts/setup-grammar.sh. This recreates grammars/rugo/ as a self-contained git repo with a deterministic commit SHA so that Zed's grammar-checkout step succeeds offline.
  3. In Zed, run zed: install dev extension and select this directory.

Re-run scripts/setup-grammar.sh whenever you edit anything under tree-sitter-rugo/. If the deterministic SHA changes, the script prints the new value — update [grammars.rugo].rev in extension.toml accordingly.

Why the bootstrap step?

Zed's extension build pipeline expects each declared grammar to live in grammars/<grammar_name>/ as a git clone whose origin URL matches the repository field in extension.toml. We satisfy that with a placeholder file:// URL and a deterministic local commit instead of relying on a remote host, keeping the grammar fully local.

License

The extension itself is Apache-2.0 (see LICENSE-APACHE). The vendored grammar retains its upstream MIT license (see tree-sitter-rugo/LICENSE).

About

Rugo extension for the Zed editor and forks

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages