tree-sitter-cooklang

Crates.iotree-sitter-cooklang
lib.rstree-sitter-cooklang
version0.0.2
sourcesrc
created_at2023-11-11 19:38:02.907677
updated_at2023-11-12 17:30:38.80847
descriptioncooklang grammar for the tree-sitter parsing library
homepage
repositoryhttps://github.com/tree-sitter/tree-sitter-cooklang
max_upload_size
id1032369
size61,086
Sébastien Iooss (Net-Mist)

documentation

README

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 (in corpus 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

screenshot

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 and runtime/queries/cooklang exists.

  • Copy the content of the queries folder to your personal runtime/queries/cooklang

  • build the grammar by doing hx --grammar build cooklang

helix screenshot

Reference

Commit count: 0

cargo fmt