-
Notifications
You must be signed in to change notification settings - Fork 2
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
Tree sitter integration is not triggering #3
Comments
Hi, I have the same issue!
Unfamiliar with elisp and Emacs internals so I'm not sure how to debug this further, I have edit |
I'm very sorry guys! GitHub didn't seem to notify me of any issues created on this repo... As for |
Thanks for looking into this! I just rebuilt with commit e11fd97. I then launch the newly built Emacs and run It seems like the grammar files are not actually being loaded. Running |
Could you try |
After evaluating |
Could you try enabling
and we'll know what's the problem. |
It seems like there is no parser in that buffer. Could you show me the value of |
I ran
I will try and rebuild with debug symbols and no optimisations later so that I can be more helpful :) |
Yup, it crashes my Emacs too. Although what you evaluated is "illegal", that definitely shouldn't crash Emacs. I'll try to add some protection against it. On the reason why it is "illegal": Could you try
on a fresh buffer with |
Oh, that's good to know! Here is the backtrace after evaluating the progn snippet:
|
Could you try again with
? Thanks. |
Looks like it highlighted the buffer! However pressing RET to start a new line with
Also if I add more text, it doesn't get highlighted until I rerun |
I pushed a fix, could you give it a try? |
It's working great for me now! Just enabling ts-c-mode gives me indentation and syntax highlighting. Thank you for your time. |
I finally found some time to test this as well now, and it seems to work reliably now. It seems the blocker concerning dynamic loading in tree-sitter has been merged. What is left for this to make it into mainline emacs? I'd love to start hacking on the major modes I maintain :) |
I've sent the patch to Emacs-devel. They haven't come around to it yet. Maybe after Emacs 28 is released? |
Hi there, @casouri and thanks for getting back to me by mail. I'll take it here because that tree-sitter thread gets very bikesheddy very fast :) I've started implementing tree-sitter for this implementation over at https://github.com/emacs-typescript/typescript.el/blob/feature/tsx-support/typescript-ts.el, and it is going pretty well actually. Kudos! However, I cannot for the life of me understand how the indentation is supposed to work, even though I've read the manual a hundred times by now. Can you help me get started with the indentation? For example, I'd like this to work for starters: function foo() {
| <-- point should be indented to spaces
} Same with: function foo() {
try {
| <-- point should be here
}
} My guess is that the first one is matching the What am I missing? |
Hey Theo, sorry that I missed your message. Judging from your latest message on emacs-devel that I just read, you already fixed or at least understand this problem? |
Yeah, I believe so. I think I'm about 90% done with the typescript mode, actually. I've also made some changes after that message pushing me even a little further, so that's good :) |
Hi there!
I've been trying to get this to work for some time now, but I cannot for the life of me get it to work. I'm using an M1 mac, so that might be an issue, but I don't think so.
(tree-sitter-available-p)
returnst
, and i've tried to move the dylibs around in different folders to get emacs to pick up on them. I've been following your RFC page and also the manuals, but no dice.Non working recipe:
casouri/emacs
on ts branch, reports that it finds tree-sitter >= 0.0batch-new.sh
and move the files indists
to/usr/local/bin
(among others)src/emacs
(require 'tree-sitter)
M-x ts-c-mode
All syntax highlighting dissapears, and
tree-sitter-inspect-mode
shows nil. I assume this is because it cannot find the dylibs, but I'm stumped atm. Could you kindly give me some pointers as to what I'm missing? I'm sorry for the probably very stupid mistake I've made :)The text was updated successfully, but these errors were encountered: