Hacky support for treesit in Emacs core#99
Open
ymarco wants to merge 8 commits intoemacs-tree-sitter:masterfrom
Open
Hacky support for treesit in Emacs core#99ymarco wants to merge 8 commits intoemacs-tree-sitter:masterfrom
ymarco wants to merge 8 commits intoemacs-tree-sitter:masterfrom
Conversation
Collaborator
|
@ymarco question: does the treesit integration in core support multi-language documents? |
Contributor
Author
|
I haven't delved much into that, it would be doable with functions like |
Contributor
Author
|
@kiennq I just saw your fork on reddit, what does it do? I couldn't make sense of the commit history... |
|
@ymarco My fork is similar to your commit with additional to:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CC @casouri
I wanted to use tree-sitter-langs packaged grammars and queries with treesit in Emacs core.
I'm not expecting these bunch of hacks to be accepted, it's more of a talking
point on compatibility/collaboration between elisp-tree-sitter and treesit.
Points:
Xto facetree-sitter-hl-face:X, whiletreesit expects
Xto be a face by itself. I tried to replaceXwithtree-sitter-hl-face:X, but seems like colons end identifier names intree-sitter's query language. What I ended up doing is replacing
Xwith theparent face of
tree-sitter-hl-face:X.match?and.eq?predicates in elisp-tree-sitter are renamed to#matchand#euqalin treesit, and
#matchhas its arguments swapped in relation to.match?libtree-sitter-X, so itcan't find tree-sitter-lang's grammars, so I symlinked each grammar file with
itself prefixed with
libtree-sitter-.