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

OCaml highlights?

Open sebastiansturm opened this issue 4 years ago • 5 comments

I noticed that emacs-tree-sitter installs tree-sitter support for OCaml, but tree-sitter-langs doesn't contain a correponding highlights.scm file. Simply copying the one from tree-sitter/tree-sitter-ocaml seems to work well though, so -- has this simply not been requested so far, or or does the highlights.scm from tree-sitter-ocaml have some drawback(s) that I'm not aware of?

sebastiansturm avatar May 05 '21 20:05 sebastiansturm

It hasn't been requested so far, and no one that uses OCaml has confirmed that the upstream query patterns are adequate. If you have verified that, can you open a pull request for it? Thanks!

ubolonton avatar Jul 24 '21 11:07 ubolonton

ok, sure!

sebastiansturm avatar Jul 26 '21 10:07 sebastiansturm

currently I'm getting loads of No such file or directory (os error 2) errors when trying to build tree-sitter-langs via tree-sitter-langs-create-bundle. Got to leave now until the late evening, plan to have another look then (did install tree-sitter-cli, and did run cask install beforehand)

sebastiansturm avatar Jul 26 '21 11:07 sebastiansturm

I finally had another go at this and noticed that the errors were caused by tree-sitter looking for tree-sitter-langs/config.json. Generating a dummy config via tree-sitter init-config and moving the generated config.json to that path "fixed" that error (in the sense of tree-sitter happily compiling grammars), but for some reason no .gz or .tar file would be created. I then replaced tree-sitter 0.20.0 by 0.19.3 (which AFAICT seems to be what your CI setup uses?) and then everything went flawlessly. If <= 0.19.3 is a requirement, adding that info to your readme might help other newbies (or if it's already there, sorry for missing it).

Highlighting now seems to work fine, so I'll open my PR some time soon

sebastiansturm avatar Aug 07 '21 17:08 sebastiansturm

I then replaced tree-sitter 0.20.0 by 0.19.3 (which AFAICT seems to be what your CI setup uses?) and then everything went flawlessly. If <= 0.19.3 is a requirement, adding that info to your readme might help other newbies (or if it's already there, sorry for missing it).

This was caused by this breaking change https://github.com/tree-sitter/tree-sitter/pull/1157. I have updated docs to mention that CLI version 0.20+ cannot currently be used.

ubolonton avatar Aug 09 '21 10:08 ubolonton