Skip to content
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

feat: Update tree-sitter-sql and migrate highlights.scm to match grammar #5772

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,7 @@ injection-regex = "sql"

[[grammar]]
name = "sql"
source = { git = "https://github.com/DerekStride/tree-sitter-sql", rev = "4fe05b2d81565ddb689d2f415e07afdacc515c52" }
source = { git = "https://github.com/DerekStride/tree-sitter-sql", rev = "286e10c5bc5d1703ee8f9afb351165a9a6182be1" }

[[language]]
name = "gdscript"
Expand Down
69 changes: 56 additions & 13 deletions runtime/queries/sql/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
(keyword_gist) @function.builtin
(keyword_btree) @function.builtin
(keyword_btree) @function.builtin
(keyword_hash) @function.builtin
(keyword_gist) @function.builtin
(keyword_spgist) @function.builtin
(keyword_gin) @function.builtin
(keyword_brin) @function.builtin
(keyword_float) @function.builtin

(invocation
name: (identifier) @function.builtin
parameter: [(field)]? @variable.other.member)
(cast
name: (identifier) @function.builtin)

(count
name: (identifier) @function.builtin
parameter: [(field)]? @variable.other.member)
name: (identifier) @function.builtin)

(keyword_group_concat) @function.builtin

(invocation
name: (identifier) @function.builtin)

(table_reference
name: (identifier) @namespace)
Expand All @@ -28,7 +29,6 @@
table_alias: (identifier) @variable.parameter
name: (identifier) @variable.other.member)


(comment) @comment

[
Expand Down Expand Up @@ -102,12 +102,16 @@
(keyword_as)
(keyword_distinct)
(keyword_constraint)
; (keyword_cast)
; (keyword_count)
; (keyword_group_concat)
(keyword_separator)
(keyword_max)
(keyword_min)
(keyword_avg)
(keyword_end)
(keyword_force)
(keyword_ignore)
(keyword_using)
(keyword_use)
(keyword_index)
Expand All @@ -117,8 +121,6 @@
(keyword_auto_increment)
(keyword_default)
(keyword_cascade)
(keyword_between)
(keyword_window)
(keyword_with)
(keyword_no)
(keyword_data)
Expand All @@ -129,6 +131,7 @@
(keyword_owner)
(keyword_temp)
(keyword_temporary)
(keyword_unlogged)
(keyword_union)
(keyword_all)
(keyword_except)
Expand All @@ -138,8 +141,35 @@
(keyword_commit)
(keyword_rollback)
(keyword_transaction)
(keyword_group_concat)
(keyword_separator)
(keyword_over)
(keyword_nulls)
(keyword_first)
(keyword_last)
(keyword_window)
(keyword_range)
(keyword_rows)
(keyword_groups)
(keyword_between)
(keyword_unbounded)
(keyword_preceding)
(keyword_following)
(keyword_exclude)
(keyword_current)
(keyword_row)
(keyword_ties)
(keyword_others)
(keyword_only)
(keyword_unique)
(keyword_concurrently)
; (keyword_btree)
; (keyword_hash)
; (keyword_gist)
; (keyword_spgist)
; (keyword_gin)
; (keyword_brin)
(keyword_like)
(keyword_similar)
(keyword_preserve)
] @keyword

[
Expand All @@ -159,6 +189,7 @@

[
(keyword_boolean)

(keyword_smallserial)
(keyword_serial)
(keyword_bigserial)
Expand All @@ -170,6 +201,7 @@
(numeric)
(keyword_real)
(double)
(float)

(keyword_money)

Expand All @@ -194,4 +226,15 @@
(keyword_geography)
(keyword_box2d)
(keyword_box3d)

(char)
(varchar)
(numeric)

(keyword_oid)
(keyword_name)
(keyword_regclass)
(keyword_regnamespace)
(keyword_regproc)
(keyword_regtype)
] @type.builtin