-
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
Highlight update #50
Highlight update #50
Conversation
Do these changes also highlight calls without parentheses? It has been a frequent request recently. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@@ -1,31 +1,29 @@ | |||
(identifier) @variable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove this one? Is it conflicting with something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For helix at least, that would match every identifier as a variable, regardless of the rest of the file due to how it parses in comparison to neovim
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we'd want more sophisticated matching of local variables anyways: https://tree-sitter.github.io/tree-sitter/syntax-highlighting#local-variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have the start of a locals.scm
above that uses those actually
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I noticed it was matching too much due to being too generic.
So I removed in a attempt to avoid multiple matches for the same node.
Helix uses Ok to have the directory structure?
|
@hugopl that works for me! |
Can you create an issue for what's needed to accomplish this? |
Nevermind... the behavior I was expecting seems not to be the behavior I see on other grammars. On: if foo
hey
else
ho
end when folding the if, I was expecting to have:
but what I get is what other languages seem to also do, fold the entire if/else/end.
So not an issue. since it's approved, could someone merge it, plz? 😁 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
Ooops, sorry for not seeing the comments. I always got confused by the github interface and keep missing things in the communication. |
This updates the highlight queries with new recent features.
It also add a injections.scm, currently just for heredoc and comments, because yes... there's a comments tree-sitter parser, hehehe. I knew about this when I tried to submit the queries to nvim-tree-sitter.
heredoc injections works nicely if you do SQL queries in heredoc strings, as you can see on github itself:
The same can be done for regexes when #49 gets fixed.