[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tree-sitter and language support

From: Roman Rudakov
Subject: Re: tree-sitter and language support
Date: Fri, 25 Nov 2022 11:41:47 +0100
User-agent: mu4e 1.8.11; emacs 29.0.50

Yuan Fu <casouri@gmail.com> writes:

On Nov 24, 2022, at 9:20 PM, T.V Raman <raman@google.com> wrote:

I installed from elpa/melpa:

ls -1 -d tree-sitter-*
21:18:06 elpa $

but emacs compiled from latest Git Head still produces the completely
unhelpful message
tree-support for language <x> is unavailable if I invoke c-ts-mode or

A note in the News file detailing what bits one needs to install might be the shoes we need to help us walk the final mile on this long road
to tree-sitter integration.

We are just starting to work on tree-sitter’s user-facing
documentation, including the (emacs) manual and NEWS file. I’ll
definitely improve the error message. In the meantime, find files that
looks like libtree-sitter-xxx.so and put them under
~/.emacs.d/tree-sitter (or a standard library location like
/usr/local/lib), and Emacs should be able to find them.


Hi Yuan!

I have a question. Are these paths hardcoded? I use MacOS, I've built a grammar for java using custom homebrew formula, it produces the file /opt/homebrew/lib/libtree-sitter-java.dylib, but when I open any java source file and try to activate java-ts-mode, I'm getting the error:

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

I can fix it by adding /opt/homebrew/lib to treesit-extra-load-path, but I'm wondering how to install grammar properly to avoid setting this variable.
Best regards, Roman

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]