Skip to content

Net-Mist/tree-sitter-cooklang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

tree-sitter grammar for cooklang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors