mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 11:50:09 -04:00
locals(lua): incorrect query for field functions
This commit is contained in:
parent
7cff1aabaa
commit
f6f402e870
1 changed files with 11 additions and 8 deletions
|
|
@ -17,13 +17,19 @@
|
||||||
(parameters (identifier) @definition))
|
(parameters (identifier) @definition))
|
||||||
(set! definition.kind "v"))
|
(set! definition.kind "v"))
|
||||||
|
|
||||||
|
;; Loops
|
||||||
|
((loop_expression
|
||||||
|
(identifier) @definition)
|
||||||
|
(set! definition.kind "v"))
|
||||||
|
|
||||||
;; Function definitions
|
;; Function definitions
|
||||||
;; Functions definitions creates both a definition and a new scope
|
;; Functions definitions creates both a definition and a new scope
|
||||||
((function
|
((function
|
||||||
(function_name_field
|
(function_name
|
||||||
object: (identifier) @definition.associated
|
(function_name_field
|
||||||
(property_identifier) @definition)) @scope
|
(identifier) @definition.associated
|
||||||
(set! definition.kind "m"))
|
(property_identifier) @definition))) @scope
|
||||||
|
(set! definition.kind "m"))
|
||||||
|
|
||||||
((function
|
((function
|
||||||
(function_name (identifier) @definition)) @scope
|
(function_name (identifier) @definition)) @scope
|
||||||
|
|
@ -36,10 +42,7 @@
|
||||||
((if_statement) @scope)
|
((if_statement) @scope)
|
||||||
((for_in_statement) @scope)
|
((for_in_statement) @scope)
|
||||||
((repeat_statement) @scope)
|
((repeat_statement) @scope)
|
||||||
;; Loops
|
((while_statement) @scope)
|
||||||
((loop_expression
|
|
||||||
(identifier) @definition)
|
|
||||||
(set! definition.kind "v"))
|
|
||||||
|
|
||||||
;;; REFERENCES
|
;;; REFERENCES
|
||||||
((identifier) @reference)
|
((identifier) @reference)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue