emacs-tree-sitter/tree-sitter-langs

Installing built grammars

0x4d6165 opened this issue · 6 comments

Hi. I'm a little unclear on what to do with the grammars after they're built? Unless I'm reading them wrong the documentation doesn't say how to install them so that tree-sitter CLI and emacs understand it, just how to build them.

meain commented

You don't have to build the grammars yourself, you just have to require this package. If you are using use-package, you should just be able to do

(use-package tree-sitter-langs
  :ensure t
  :after tree-sitter)

Still getting the error

Warning (treesit): Cannot activate tree-sitter, because language grammar for bash is unavailable (not-found): (libtree-sitter-bash libtree-sitter-bash.so) No such file or directory

I am using emacs-29 branch though.

meain commented

We don't have compatibility with builtin treesit package which is what it looks like you are trying to use. This repo only works with https://github.com/emacs-tree-sitter/elisp-tree-sitter as of now. There is some discussion about supporting builtin treesit which you can follow at #157

Ohhhh I see! I didn't realize they were separate packages. Thank you for clarifying.

meain commented

You can follow it at #144