-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Add missing rust query #122
base: master
Are you sure you want to change the base?
Conversation
Note that the current neovim treesitter implementation only captures anything inside a rust macro via token_tree, so we need this new query to capture <T>.
I don't know Rust, so I need some help here. Looking at the syntax tree of the test file I don't see any
On a side note, I get ten errors in the syntax tree when I use |
The
but that doesn't seem to work inside macros in Rust. In general, I can't get correct highlighting inside macros without I also get the |
I looked into this a bit more and I think I remember why we added the other
This is also the reason we have the |
I have opened a new issue for the discrepancy in error reports: neovim/neovim#29726 I suggest we put this issue on hold for now until we know wheter there is a bug in Neovim or the parser, or if things really are that complicated. If there is a but we get the fix for free, and if the problem is on our end we can still solve it the hard way. |
Note that the current neovim treesitter implementation only captures anything inside a rust macro via token_tree, so we need this new query to capture
<T>
.I added some examples in the test file, but the only thing the new query fixes is the line with:
I only just now figured out that we don't actually capture the stuff inside macros via the standard queries, we only capture things inside e.g. a
vec!
viatoken_tree
.I thought that knowing this might help fixing the highlighting in C/C++ too (see #80), but it seems that the "self-injections" don't work the same there, so I couldn't see any easy fix to the current problems there.