Skip to content

Commit

Permalink
feat: Update tree-sitter-sql and migrate highlights.scm to match …
Browse files Browse the repository at this point in the history
…grammar (#5772)

* Sort buildin functions alphabetically

* fix: Query float type like other numeric types

* Update tree-sitter-sql and update highlights.scm to match grammar
  • Loading branch information
LeoniePhiline authored Feb 2, 2023
1 parent 10fee81 commit 3041236
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 14 deletions.
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

0 comments on commit 3041236

Please sign in to comment.