-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
bump tree-sitter-sql #8464
bump tree-sitter-sql #8464
Conversation
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.
Would you prefer me to make the diff easier by moving things around in the file to make the keywords align with the current highlights file, or would it be nicer to keep the order of upstream so that future changes upstream are easier to follow?
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 think it would be nicer to follow the upstream highlights closely so that when they make changes to the highlights upstream it's clear where to make changes when we update the grammar. But I don't look at SQL much so I'm not sure if the queries we have in master are significantly better than the new ones in the repo (- looks like they were added since the last time we updated). If you think the new ones look good then let's use those (with the adjustments to the Helix capture names)
runtime/queries/sql/highlights.scm
Outdated
(binary_expression | ||
operator: _ @operator) | ||
((literal) @constant.numeric.integer | ||
(#lua-match? @constant.numeric.integer "^%d+$")) |
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.
(#lua-match? @constant.numeric.integer "^%d+$")) | |
(#match? @constant.numeric.integer "^\d+$")) |
#lua-match?
is nvim-specific. We use just the ones tree-sitter provides in the rust bindings https://tree-sitter.github.io/tree-sitter/using-parsers#predicates (though there are some there like #any-of?
that we don't implement yet because we're waiting on a tree-sitter release that adds them)
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.
Also resolved. Thanks for your patience, I'm new to this tree-sitter world so don't know many of the keywords/possibilities yet, but it looks interesting
runtime/queries/sql/highlights.scm
Outdated
(unary_expression | ||
operator: _ @operator) | ||
((literal) @constant.numeric.float | ||
(#lua-match? @constant.numeric.float "^[-]?%d*\.%d*$")) |
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.
Same here - I think the regex from the old highlights should work in place of this one (I think the %d
is lua-regex-specific)
* bump tree-sitter-sql * update highlights classes to helix flavour * replace lua-match with match
* bump tree-sitter-sql * update highlights classes to helix flavour * replace lua-match with match
* bump tree-sitter-sql * update highlights classes to helix flavour * replace lua-match with match
* bump tree-sitter-sql * update highlights classes to helix flavour * replace lua-match with match
Bumps to DerekStride/tree-sitter-sql@eeab724 (the commit with the compiled grammar corresponding to
main
commit DerekStride/tree-sitter-sql@385aff4)Changes since previous revision (DerekStride/tree-sitter-sql@7cbac04, 19 June):
group_concat
and_aggregate_function
toinvocation
DerekStride/tree-sitter-sql#163filter
toaggregate_functions
DerekStride/tree-sitter-sql#168merge into
upsert statements DerekStride/tree-sitter-sql#182explain
,truncate
andalter
/drop
/create schema
DerekStride/tree-sitter-sql#187generated always
statement DerekStride/tree-sitter-sql#194Also see: #7387