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

Relationship to kiennq/treesit-langs #3

Open
FrauH0lle opened this issue Sep 8, 2024 · 4 comments
Open

Relationship to kiennq/treesit-langs #3

FrauH0lle opened this issue Sep 8, 2024 · 4 comments
Labels
question Further information is requested

Comments

@FrauH0lle
Copy link

Hey there

I was looking into using the builtin treesit functionalities from Emacs 29+ and looked through available packages and how they work.

During my search I stumbled across this repository but also found https://github.com/kiennq/treesit-langs.
@kiennq 's fork seems to be older and besides makeing the tree-sitter libraries available to Emacs, it also provides a parser for the *.scm files and a highlighting minor mode similar to the elisp-tree-sitter package.
However, the highlighting files are also different from the ones in tree-sitter-langs (at least in part, e.g. for Python).

Are there any plans to merge the work? From a user perspective it would be great to have a central place for tree-sitter packages.

@jcs090218
Copy link
Member

This repo is designed to work with the built-in Tree-sitter module, treesit.el. AFAIK treesit.el has the built-in highlighting functionality; therefore, unlike tree-sitter.el, you don't need the *.scm files. This package removed everything and only provided the pre-built binaries, which will be installed in the correct location.

@kiennq
Copy link

kiennq commented Sep 9, 2024

The kiennq/treesit-langs serves different purposes, it

  • intends to work with the Emacs's built-in tree-sitter
  • provides the pre-built parser binaries, and
  • overrides the highlighting functionality of the built-in tree-sitter major modes and provides the tree-sitter highlighting ability for non-tree-sitter major modes.
    The highlights.scm are gotten either from nvim-treesitter or from the parser directly.
    Just my preference but I found the highlightings are more consistent than the tree-sitter major modes.

@jcs090218
Copy link
Member

intends to work with the Emacs's built-in tree-sitter

I didn't know it intended to work with the built-in tree-sitter. That's awesome! :D

@jcs090218 jcs090218 added the question Further information is requested label Sep 9, 2024
@jcs090218 jcs090218 pinned this issue Sep 9, 2024
@FrauH0lle
Copy link
Author

FrauH0lle commented Sep 14, 2024

Thanks a lot @jcs090218 and @kiennq for your replies.

and provides the tree-sitter highlighting ability for non-tree-sitter major modes
This is a huge advantage helps a lot with major modes like ESS R which do not provide a new tree-sitter major mode yet.

Together with being able to change the highlighting via .scm files I would say that kiennq's package is basically a drop-in replacement for elisp-tree-sitter for Emacs 29+.

Only "issue" I have been facing is that the highlighting varies between the different implementations, e.g.
using elisp-tree-sitter
python_tree-sitter
using treesit-langs
python_treesit-langs
and using python-ts-mode with treesit-font-lock-level = 4
python_treesit

But anyways, I wanted to know if the two projects are aware of each other and my question has been answered. Thanks a lot again!

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

No branches or pull requests

3 participants