help-emacs-windows
[Top][All Lists]
Advanced

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

Re: tree-sitter on Windows


From: Corwin Brust
Subject: Re: tree-sitter on Windows
Date: Sat, 30 Sep 2023 08:55:50 -0500

On Sat, Sep 30, 2023 at 4:23 AM Juan José García-Ripoll
<juanjose.garciaripoll@gmail.com> wrote:
>
> Hi everyone,
>

Hi Juan José!

>
> I am having a hard time installing tree-sitter DLL's in Windows. I have
> installed the treesitter language pack (I believe from MELPA IIRC),
> which downloads plenty of dlls, but they do not have the prefix
> "libtree-" and then Emacs cannot find them. I tried renaming them at
> their location in the package, but that also does not work. I tried
> copying them to the ~/.emacs.d/tree-sitter and also does not work. I
> tried modifying exec-path, and that also does not work... It is quite
> disappointing. How am I supposed to do this?
>

Sounds frustrating!   I'm assuming you looked at the NEWS file from
29.1 and reviewed the information there about getting started.   There
are also some recently updated notes on the EmacsWiki that might help:

https://www.emacswiki.org/emacs/Tree-sitter

I notice you renamed to "libtree-" so maybe you are missing the
"sitter-" part from your filenames.  That is, you might be creating
libtree-FOO.dll when you should create libtree-sitter-FOO.dll, per
this quote from NEWS;

: link these two files into a shared library named
: "libtree-sitter-LANG.so" ("libtree-sitter-LANG.dll" on MS-Windows,
: "libtree-sitter-LANG.dylib" on macOS), where LANG is the name of the
: language supported by the grammar as it is expected by the Emacs major
: mode (for example, "c" for 'c-ts-mode', "cpp" for 'c++-ts-mode',
: "python" for 'python-ts-mode', etc.)

Finally, given you are on Windows and are willing to download some
DLLs crafted by yours truly, here are some "minimal" instructions that
I think should "just work":

1. grab the tree-sitter DLLs that you want to from my site:
https://corwin.bru.st/emacs-tree-sitter

2. save them, per NEWS, into the: "tree-sitter" subdirectory of your
'user-emacs-directory', or in a directory mentioned in the variable
'treesit-extra-load-path'

3. Per the EmacsWiki page linked above: Customise
‘major-mode-remap-alist’ with each entry having as the key the major
mode you wish to redirect to Tree-sitter, and the value being the
equivalent “…-ts-…” mode. For example ‘java-mode’ would be remapped to
‘java-ts-mode’.

Note, I try to give the tree-sitter grammer DLLs I make the correct
names; if you try the above and find you need to rename stuff --or
have other problems I might be able to address-- please let me know.

Kind regards,

> Best,
>
> Juanjo
>
> --
> Juan José García Ripoll
> http://juanjose.garciaripoll.com
> http://quinfog.hbar.es
>
>



reply via email to

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