Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify instructions for installing tree-sitter grammar? #4

Open
timcharper opened this issue Feb 14, 2024 · 1 comment
Open

Clarify instructions for installing tree-sitter grammar? #4

timcharper opened this issue Feb 14, 2024 · 1 comment

Comments

@timcharper
Copy link

timcharper commented Feb 14, 2024

I'm not a tree-sitter pro by any means. I've noticed that grammar is in version "0.12.86" of tree-sitter-langs, however, when I tried to load it, even though (tree-sitter-require 'mermaid) returned t, (treesit-ready-p 'mermaid) still returned nil.

However, what did work was this:

(customize and set variable tree-sitter-langs-git-dir to ~/.emacs.d/tree-sitter/grammars/)

  (setq treesit-language-source-alist
   '((mermaid "https://github.com/monaqa/tree-sitter-mermaid")))

M-x treesit-install-language-grammar "mermaid"

Then, (treesit-ready-p 'mermaid) returned true.

I'm not entirely sure why the version in tree-sitter-langs was insufficient, but I thought this would be at least an interesting thing to raise, and perhaps a good note for the README?

@kiennq
Copy link

kiennq commented Jun 16, 2024

tree-sitter-langs and the built-in treesit are different thing. For the built-in tree-sit to work with binaries from tree-sitter-langs, you will need to add that path to treesit-extra-load-path. Also, the tree-sitter parsers have to be named in the format of libtree-sitter-<lang>.<ext>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants