The languages that go through tree-sitter (Go, Kotlin, C, PowerShell, plus the Markdown text extensions used byDocumentation Index
Fetch the complete documentation index at: https://mehen.ophi.dev/llms.txt
Use this file to discover all available pages before exploring further.
mehen-markdown) are parsed via pinned tree-sitter-<lang> crates. Grammars
change over time and need periodic updates — both for bug fixes and to keep up with new syntax.
Grammars can be updated on Linux and macOS natively, or on Windows using WSL.
Currently pinned tree-sitter grammars
The pin lives inxtask/Cargo.toml (consumed by the kind-enum generator) and in the owning
crates/mehen-<lang>/Cargo.toml (consumed by the analyzer at runtime). Most grammars are routed
through [workspace.dependencies] in the root Cargo.toml and referenced as
{ workspace = true } from both call sites; some, like tree-sitter-c, are inline-pinned because
only one analyzer consumes them.
| Grammar | Used by |
|---|---|
tree-sitter-c | mehen-c |
tree-sitter-go | mehen-go |
tree-sitter-kotlin-sg | mehen-kotlin |
tree-sitter-pwsh | mehen-powershell |
tree-sitter-markdown-text | mehen-markdown (auxiliary) |
grammar.rs and need no kind-enum regeneration. Markdown’s primary parser
is pulldown-cmark; the tree-sitter Markdown grammar is only used for ancillary text extensions.
Update process
Bump the pin
Update all locations the grammar is pinned. For workspace-routed grammars, that’s the line in
root
Cargo.toml [workspace.dependencies]. For inline-pinned grammars, both xtask/Cargo.toml
and the owning crates/mehen-<lang>/Cargo.toml:Regenerate kind enums
grammar.rs from the pinned grammar’s node-kind
table. CI runs cargo xtask tree-sitter check-generated to ensure pinned-grammar bumps without a
regenerate are caught at PR time.Fix breakage
New node kinds may appear (and need handling), and existing node kinds may be renamed or
restructured. Update analyzer code accordingly.
Automation
Dependabot raises grammar bump PRs automatically. Theregenerate-grammars workflow detects those
PRs (branch name contains tree-sitter) and runs cargo xtask tree-sitter generate --all plus the
test suite, then commits the regenerated files back to the PR branch. Reviewers should still verify
analyzer code still handles any renamed kinds.