emacs-devel
[Top][All Lists]
Advanced

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

Re: tree-sitter version?


From: Tassilo Horn
Subject: Re: tree-sitter version?
Date: Thu, 24 Nov 2022 06:54:53 +0100
User-agent: mu4e 1.9.3; emacs 29.0.50

Yuan Fu <casouri@gmail.com> writes:

Hi Yuan,

>> So: am I supposed to install tree-sitter from github or from debian's
>> package manager?
>
> Either should be fine.

Ah, I was wondering the same when I wanted to give tree-sitter a try.  I
have tree-sitter 0.20.7 installed but the configure output said
">=0.20.2 no" but only reported a >= 0.6.x version.  It still works
fine. :-)

>> I first did the package-manager version, then pulled from github and
>> installed that -- configure shows that tree-sitter is detected -- but
>> calling any of the tree-sitter modes, eg c-ts-mode barfs with an
>> error saying that support is not available.
>
> If you call tree-sitter-available-p, what do you get? Most likely you
> don’t have the relevant language definition/grammar for those
> modes. You can probably find them on package managers, or you can
> build with the script here:

Indeed, that was the next trap I fell in.  On Arch, tree-sitter is in
the community repository (so basically almost official) whereas the
language definitions are only on the AUR.  Maybe the NEWS entry should
tell more clearly that tree-sitter needs to be system-installed and also
the language definitions need to be grabbed somewhere.

BTW, how can a user decide that tree-sitter modes should be used?  For
example, when I open a json file I get js-json-mode, not json-ts-mode,
which also works, so support is available.  Should user's augment
auto-mode-alist?  Or is there some "enable TS whenever possible and the
devs think its support is in a usable state for that language" toggle?

Bye,
Tassilo



reply via email to

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