terrateamio / ocaml-ts-mode

Ocaml mode for emacs using treesitter
MIT License
10 stars 1 forks source link

`treesit-language-source-alist` in README.md might be outdated #3

Open AbrA-K opened 4 hours ago

AbrA-K commented 4 hours ago

I had trouble with getting the treesitter to install. In the source of "https://github.com/tree-sitter/tree-sitter-ocaml" gives 3 locations of a parser.c. None of them where in ocaml/source and I had luck with the one in grammars/ocaml/src/.

So I would maybe update this part in the README.md:

   (setq treesit-language-source-alist
      '((ocaml "https://github.com/tree-sitter/tree-sitter-ocaml" "master" "ocaml/src")))

to:

   (setq treesit-language-source-alist
      '((ocaml "https://github.com/tree-sitter/tree-sitter-ocaml" "master" "grammars/ocaml/src/")))

Note that I'm pretty new to emacs and I don't know a whole lot about treesitter and this just worked for me. I might be wrong, especially because it gives me warning about unavailable language grammars for ocaml-interface.

AbrA-K commented 3 hours ago

aah you also need to install the interface.

   (setq treesit-language-source-alist
      '((ocaml "https://github.com/tree-sitter/tree-sitter-ocaml" "master" "grammars/ocaml/src/")
         (ocaml-interface "https://github.com/tree-sitter/tree-sitter-ocaml" "master" "grammars/interface/src/")))

and then treesit-install-language-grammar them both (maybe ocaml first, ocaml-interface after)