From 27affdca04b1cd21d7e3b5bcf14d478aef1e1273 Mon Sep 17 00:00:00 2001 From: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com> Date: Wed, 1 Feb 2023 19:10:10 +0100 Subject: [PATCH 1/3] Sort buildin functions alphabetically --- runtime/queries/sql/highlights.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/runtime/queries/sql/highlights.scm b/runtime/queries/sql/highlights.scm index aad5ed318cb8..7295e933a9c6 100644 --- a/runtime/queries/sql/highlights.scm +++ b/runtime/queries/sql/highlights.scm @@ -1,7 +1,6 @@ -(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 From 84b2d7e2f1326da71fb61d870d0f4dc750262000 Mon Sep 17 00:00:00 2001 From: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com> Date: Wed, 1 Feb 2023 19:11:02 +0100 Subject: [PATCH 2/3] fix: Query float type like other numeric types --- runtime/queries/sql/highlights.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/queries/sql/highlights.scm b/runtime/queries/sql/highlights.scm index 7295e933a9c6..8d469c877eb3 100644 --- a/runtime/queries/sql/highlights.scm +++ b/runtime/queries/sql/highlights.scm @@ -4,7 +4,6 @@ (keyword_spgist) @function.builtin (keyword_gin) @function.builtin (keyword_brin) @function.builtin -(keyword_float) @function.builtin (invocation name: (identifier) @function.builtin @@ -169,6 +168,7 @@ (numeric) (keyword_real) (double) + (float) (keyword_money) From 80ff466283a001e202fcb4ed00441121804602fa Mon Sep 17 00:00:00 2001 From: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com> Date: Wed, 1 Feb 2023 19:12:53 +0100 Subject: [PATCH 3/3] Update tree-sitter-sql and update highlights.scm to match grammar --- languages.toml | 2 +- runtime/queries/sql/highlights.scm | 64 +++++++++++++++++++++++++----- 2 files changed, 55 insertions(+), 11 deletions(-) diff --git a/languages.toml b/languages.toml index 755f577ffa0e..09ba2a2a160c 100644 --- a/languages.toml +++ b/languages.toml @@ -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" diff --git a/runtime/queries/sql/highlights.scm b/runtime/queries/sql/highlights.scm index 8d469c877eb3..a2d2f7feb911 100644 --- a/runtime/queries/sql/highlights.scm +++ b/runtime/queries/sql/highlights.scm @@ -5,13 +5,16 @@ (keyword_gin) @function.builtin (keyword_brin) @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) @@ -26,7 +29,6 @@ table_alias: (identifier) @variable.parameter name: (identifier) @variable.other.member) - (comment) @comment [ @@ -100,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) @@ -115,8 +121,6 @@ (keyword_auto_increment) (keyword_default) (keyword_cascade) - (keyword_between) - (keyword_window) (keyword_with) (keyword_no) (keyword_data) @@ -127,6 +131,7 @@ (keyword_owner) (keyword_temp) (keyword_temporary) + (keyword_unlogged) (keyword_union) (keyword_all) (keyword_except) @@ -136,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 [ @@ -157,6 +189,7 @@ [ (keyword_boolean) + (keyword_smallserial) (keyword_serial) (keyword_bigserial) @@ -193,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