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`.
This commit is contained in:
adaitche 2025-12-09 10:53:37 +01:00 committed by GitHub
parent a98a740c55
commit 02693ce64c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,8 +13,12 @@
(keyword_object_id) (keyword_object_id)
] @function.call ] @function.call
(object_reference ((object_reference
name: (identifier) @type) name: (identifier) @type) @_obj_ref
(#not-has-parent? @_obj_ref invocation))
(cte
(identifier) @type)
(relation (relation
alias: (identifier) @variable) alias: (identifier) @variable)