emacs-devel
[Top][All Lists]
Advanced

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

Re: Tree-sitter integration on feature/tree-sitter


From: Theodor Thornhill
Subject: Re: Tree-sitter integration on feature/tree-sitter
Date: Sun, 08 May 2022 21:16:00 +0200

>
> My understanding was that tree-sitter can load these *.js parsers as
> they are downloaded from the respective sites, or that there are tools
> available to compile them if needed.  Why cannot we leave it to users
> to do that by themselves, instead of using an Emacs module?

Oh right, now I understand.  The tree sitter implementation doesn't use
an Emacs module any longer.  It uses the language definitions libraries
like any other editor.  If you use the tree-sitter-module script you
should use the 'batch-new.sh' script. This only creates a .so file.  My
guess is that you could use any guide on the internet to compile such a
shared object, then use it in emacs.  It seems to be a bit picky on the
naming; it needs to be called 'libtree-sitter-LANG.so', which should
probably be documented somewhere.  I cannot see that it is, yet.

So in short: Emacs cannot load the .js directly, but when downloaded
they should be compiled to a .so/.dll/.dylib and put somewhere emacs can
see it, such as ~/.emacs.d/tree-sitter.  This could be left to the user,
but it would be nice for emacs to do this, or at least a package in
elpa/nongnu elpa that does this so that the barrier of entry isn't too
high.

I think I understood your concern now, does this answer help?

Theodor



reply via email to

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