mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
Merge pull request #22 from vigoux/fix/lua-locals-highlights
Fix lua queries
This commit is contained in:
commit
931c2c67ce
2 changed files with 12 additions and 8 deletions
|
|
@ -50,6 +50,7 @@
|
|||
|
||||
;; Nodes
|
||||
(function "function" @function "end" @function)
|
||||
(local_function "function" @function "end" @function)
|
||||
(table "{" @operator "}" @operator)
|
||||
(comment) @comment
|
||||
(string) @string
|
||||
|
|
|
|||
|
|
@ -17,13 +17,19 @@
|
|||
(parameters (identifier) @definition))
|
||||
(set! definition.kind "v"))
|
||||
|
||||
;; Loops
|
||||
((loop_expression
|
||||
(identifier) @definition)
|
||||
(set! definition.kind "v"))
|
||||
|
||||
;; Function definitions
|
||||
;; Functions definitions creates both a definition and a new scope
|
||||
((function
|
||||
(function_name_field
|
||||
object: (identifier) @definition.associated
|
||||
(property_identifier) @definition)) @scope
|
||||
(set! definition.kind "m"))
|
||||
(function_name
|
||||
(function_name_field
|
||||
(identifier) @definition.associated
|
||||
(property_identifier) @definition))) @scope
|
||||
(set! definition.kind "m"))
|
||||
|
||||
((function
|
||||
(function_name (identifier) @definition)) @scope
|
||||
|
|
@ -36,10 +42,7 @@
|
|||
((if_statement) @scope)
|
||||
((for_in_statement) @scope)
|
||||
((repeat_statement) @scope)
|
||||
;; Loops
|
||||
((loop_expression
|
||||
(identifier) @definition)
|
||||
(set! definition.kind "v"))
|
||||
((while_statement) @scope)
|
||||
|
||||
;;; REFERENCES
|
||||
((identifier) @reference)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue