Tree-sitter grammar for the Jam programming language.
The grammar is published on crates.io as tree-sitter-jam. Add it to your Cargo.toml:
[dependencies]
tree-sitter = "0.25"
tree-sitter-jam = "0.1"Then load the language and parse Jam source:
let mut parser = tree_sitter::Parser::new();
parser.set_language(&tree_sitter_jam::LANGUAGE.into()).expect("load Jam grammar");
let tree = parser.parse("const MAX: u32 = 64;", None).unwrap();Highlight queries live in queries/highlights.scm and are bundled into the crate via include in Cargo.toml.
The Zed extension lives in editors/zed/ — a language-only extension that references this grammar over git. (Install the editors/zed/ folder, not the repo root: Zed sees the root Cargo.toml and tries to build a Rust extension, which fails.)
To install it as a local dev extension:
- Open Zed.
- Open the command palette:
Cmd-Shift-P. - Run
zed: install dev extension. - In the file picker, select the
editors/zed/folder of this repository.
Zed reads extension.toml, clones the grammar from the configured repository at the pinned commit, compiles src/parser.c, and loads the editors/zed/languages/jam/ config and queries.
Open any .jam file to confirm — syntax highlighting should kick in, and the language indicator in the bottom-right status bar should read Jam.
- After editing queries or
editors/zed/languages/jam/config.toml, runzed: reload extensionsto pick up the changes. - If you change the grammar itself, regenerate the parser, commit and push it, then bump
revinextension.tomlto the new commit before reloading.
- View the log via the command palette →
zed: open log. - For verbose output, launch Zed from a terminal:
/Applications/Zed.app/Contents/MacOS/zed --foreground.