tree-sitter-crystal
tree-sitter-crystal copied to clipboard
It doesn't work with tree-sitter CLI
How to reproduce:
- Git clone the repository to a path under tree-sitter
parser-directories
configuration. - Run
tree-sitter highlight hello.cr
You get:
No language found for path "hello.cr"
Expected behavior:
- The hello.cr file highlighted in terminal.
The output of dump-languages:
$ tree-sitter dump-languages
scope:
parser: "/home/hugo/src/tree-sitter-crystal"
highlights: None
file_types: []
content_regex: None
injection_regex: None
scope: source.ruby
parser: "/home/hugo/src/tree-sitter-ruby/"
highlights: None
file_types: ["rb"]
content_regex: None
injection_regex: Some(ruby)
The ruby parser that I already have installed works, so my tree-sitter setup is fine.
Hey, I'm still working on finishing the grammar definition and haven't added any highlighting yet, so this behavior is expected at this time.
I've added a README file so the state of the project is more obvious.
Did you check other tree-sitter crystal projects on github?
- https://github.com/will/tree-sitter-crystal
- https://github.com/Ogromny/tree-sitter-crystal
I was not able to make neither of them work, but maybe they can be useful as reference for this project.
I'm writing a GTK4 code widget in Crystal and plan to use tree-sitter as highlighter engine, so besides doing the bindings for tree-sitter C API I was also looking for crystal grammars, so I can highlight my code with itself :slightly_smiling_face: