-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
update languages.toml: tree-sitter-lua grammar #9727
update languages.toml: tree-sitter-lua grammar #9727
Conversation
repo has moved, use new URL and the rev of the latest release (v0.0.19)
Very often, when you update a version of the Tree-sitter grammar, the node names change, causing the current helix queries to become inaccurate. Check the changelog and update our queries accordingly. |
Are there any tools or docs to help validate that changes to these queries correctly map to helix expectations? I assume it's not ok to just copy the query files over from the I spent about an hour trying to learn about this. I started by poking around at the files in the At the moment, this looks like it'll take a while to learn enough to update the queries with any confidence. |
The queries that are in that repo are ok to copy but they'll need some small modifications. We use a custom set of captures https://docs.helix-editor.com/master/themes.html#syntax-highlighting, so We will also need to re-order the patterns a little because neovim currently has the opposite precedence compared to us (though that will change with #9436). So this identifier pattern needs to move to basically the bottom of the file: after all other uses of In general you can use |
a novice attempt to port query updates from the source repo to Helix captures and ordering
Thanks for the guidance! I attempted to follow it. I'm not very confident that I got the ordering or captures correct. The Aside: I was a bit confused how the |
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
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.
Thanks!
|
* update languages.toml: tree-sitter-lua grammar repo has moved, use new URL and the rev of the latest release (v0.0.19) * update highlight queries a novice attempt to port query updates from the source repo to Helix captures and ordering * Apply suggestions from code review Co-authored-by: Michael Davis <mcarsondavis@gmail.com> --------- Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* update languages.toml: tree-sitter-lua grammar repo has moved, use new URL and the rev of the latest release (v0.0.19) * update highlight queries a novice attempt to port query updates from the source repo to Helix captures and ordering * Apply suggestions from code review Co-authored-by: Michael Davis <mcarsondavis@gmail.com> --------- Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* update languages.toml: tree-sitter-lua grammar repo has moved, use new URL and the rev of the latest release (v0.0.19) * update highlight queries a novice attempt to port query updates from the source repo to Helix captures and ordering * Apply suggestions from code review Co-authored-by: Michael Davis <mcarsondavis@gmail.com> --------- Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* update languages.toml: tree-sitter-lua grammar repo has moved, use new URL and the rev of the latest release (v0.0.19) * update highlight queries a novice attempt to port query updates from the source repo to Helix captures and ordering * Apply suggestions from code review Co-authored-by: Michael Davis <mcarsondavis@gmail.com> --------- Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
repo has moved, use new URL and the rev of the latest release (v0.0.19)
There is a more recent release of the tree-sitter-lua grammar (and new repo url, which appears to be the same repo, just moved):
tree-sitter-grammars/tree-sitter-lua@88e4464
I'm a first-time contributor, opening this PR per request from @archseer on #9726.
I tested locally by adding a
.config/helix/languages.toml
file with the following content (thesource =
line is the same content as this PR):Then updated the grammar:
% hx --grammar fetch Fetching 1 grammars 1 updated grammars lua now on 88e446476a1e97a8724dff7a23e2d709855077f2 % hx --grammar build Building 1 grammars 1 grammars built now ["lua"]
Then confirmed that the new grammar is being used. It is, yea!
fixes: #9726