-
Notifications
You must be signed in to change notification settings - Fork 127
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
Hacky support for treesit in Emacs core #99
base: master
Are you sure you want to change the base?
Conversation
@ymarco question: does the treesit integration in core support multi-language documents? |
I haven't delved much into that, it would be doable with functions like |
@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:
|
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:
X
to facetree-sitter-hl-face:X
, whiletreesit expects
X
to be a face by itself. I tried to replaceX
withtree-sitter-hl-face:X
, but seems like colons end identifier names intree-sitter's query language. What I ended up doing is replacing
X
with theparent face of
tree-sitter-hl-face:X
.match?
and.eq?
predicates in elisp-tree-sitter are renamed to#match
and#euqal
in treesit, and
#match
has 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-
.