Tree-sitter-cooklang
This is an unofficial tree-sitter grammar for Cooklang.
Testing the grammar
tree-sitter generateto compile the grammar and generate the different bindings.tree-sitter testto run the tests (incorpusfolder)make cleanto remove all generated files
Using the syntax highlight
With tree-sitter
To use the syntax highlight with tree-sitter, follow the indication in the doc. Then you can run tree-sitter highlight {your_file}.cook. You should see something like

With Helix
Follow the indication in the adding languages page, or:
-
Edit your
language.tomlfile to add[[]] = "cooklang" = "source.cook" = ["cook"] = [] [[]] = "cooklang" = { = "/local/path/to/tree-sitter-cooklang"} -
In your helix configuration folder, be sure that the folders
runtime/grammarsandruntime/queries/cooklangexists. -
Copy the content of the
queriesfolder to your personalruntime/queries/cooklang -
build the grammar by doing
hx --grammar build cooklang
