2 releases
0.0.2 | Nov 12, 2023 |
---|---|
0.0.1 | Nov 11, 2023 |
#331 in Text editors
45KB
1.5K
SLoC
Tree-sitter-cooklang
This is an unofficial tree-sitter grammar for Cooklang.
Testing the grammar
tree-sitter generate
to compile the grammar and generate the different bindings.tree-sitter test
to run the tests (incorpus
folder)make clean
to 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.toml
file to add[[language]] name = "cooklang" scope = "source.cook" file-types = ["cook"] roots = [] [[grammar]] name = "cooklang" source = { path = "/local/path/to/tree-sitter-cooklang"}
-
In your helix configuration folder, be sure that the folders
runtime/grammars
andruntime/queries/cooklang
exists. -
Copy the content of the
queries
folder to your personalruntime/queries/cooklang
-
build the grammar by doing
hx --grammar build cooklang
Reference
Dependencies
~2.7–4MB
~75K SLoC