tree-sitter-crystal icon indicating copy to clipboard operation
tree-sitter-crystal copied to clipboard

It doesn't work with tree-sitter CLI

Open hugopl opened this issue 2 years ago • 2 comments

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.

hugopl avatar Jul 05 '22 02:07 hugopl

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.

keidax avatar Jul 06 '22 04:07 keidax

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:

hugopl avatar Jul 06 '22 17:07 hugopl