-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
#is-not? local
query cannot extend inference to multiple nodes
#7
Comments
#is-not? local
query does not quite work as expected#is-not? local
query cannot extend inference to multiple nodes
edit: actually I read this wrong 😅 I think there's a highlights query that could cover this though, I'll try some out 👍 |
I think this might be a bug in tree-sitter queries. ; highlights.scm
((function_call
function: (field_access
record: (identifier) @module
field: (identifier) @function))
(#is-not? local)) I would expect the |
Right, which is quite weird. Since |
I was looking around and this slice of the documentation caught my eye:
In particular the way that the last sentence is worded suggests to me that the current behavior is intended. Based on the existing I think the revelant change would be to the C source which I'm not at all familiar with. I'll keep looking to see how difficult this change might be. I suspect it can't be too difficult because the behavior we expect matches the behavior of |
I opened up tree-sitter/tree-sitter#1597 to discuss it. It looks like the locals information is currently only determined and then used for highlights in a single pass over a QueryCursor. For the query we want, this isn't a problem, but for generally being able to use Footnotes
|
@the-mikedavis Thank you for your diligent work on this! 🎉 🎊 Seeing as tree-sitter/tree-sitter#1602 is now merged, this issue is fit to be closed. Once the latest version of |
I noticed some strange behavior with the syntax highlighting of records vs records with functions. Consequently, I tried to introduce this test:
However, this test fails with this error:
So the syntax highlighter is able to determine that
local_record
is a variable, not a module, but it is not able to extend that inference to imply that therefore the second part of thefield_access
must be aproperty
instead of afunction
.The text was updated successfully, but these errors were encountered: