aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries
diff options
context:
space:
mode:
authoradaitche <anton@daitche.org>2025-12-09 10:53:37 +0100
committerGitHub <noreply@github.com>2025-12-09 10:53:37 +0100
commit02693ce64c87e43eaa0e11e907116b2190217d07 (patch)
treeea76ce31819d836f8f09c904f88d7c48164f23e4 /runtime/queries
parentfeat(parsers): update brightscript, desktop, gotmpl, helm, ini, javadoc, mlir... (diff)
downloadnvim-treesitter-02693ce64c87e43eaa0e11e907116b2190217d07.tar
nvim-treesitter-02693ce64c87e43eaa0e11e907116b2190217d07.tar.gz
nvim-treesitter-02693ce64c87e43eaa0e11e907116b2190217d07.tar.bz2
nvim-treesitter-02693ce64c87e43eaa0e11e907116b2190217d07.tar.lz
nvim-treesitter-02693ce64c87e43eaa0e11e907116b2190217d07.tar.xz
nvim-treesitter-02693ce64c87e43eaa0e11e907116b2190217d07.tar.zst
nvim-treesitter-02693ce64c87e43eaa0e11e907116b2190217d07.zip
feat(sql): improve `@type` capture (#8315)
Problem: `@type` currently captures function calls but fails to capture CTE names. Solution: Don't capture types in invocations. Add pattern for `cte`.
Diffstat (limited to 'runtime/queries')
-rw-r--r--runtime/queries/sql/highlights.scm8
1 files changed, 6 insertions, 2 deletions
diff --git a/runtime/queries/sql/highlights.scm b/runtime/queries/sql/highlights.scm
index b3a0c71c6..7a201a026 100644
--- a/runtime/queries/sql/highlights.scm
+++ b/runtime/queries/sql/highlights.scm
@@ -13,8 +13,12 @@
(keyword_object_id)
] @function.call
-(object_reference
- name: (identifier) @type)
+((object_reference
+ name: (identifier) @type) @_obj_ref
+ (#not-has-parent? @_obj_ref invocation))
+
+(cte
+ (identifier) @type)
(relation
alias: (identifier) @variable)