Merge pull request #22 from vigoux/fix/lua-locals-highlights

Fix lua queries
This commit is contained in:
Thomas Vigouroux 2020-04-23 10:31:02 +02:00 committed by GitHub
commit 931c2c67ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 8 deletions

View file

@ -50,6 +50,7 @@
;; Nodes ;; Nodes
(function "function" @function "end" @function) (function "function" @function "end" @function)
(local_function "function" @function "end" @function)
(table "{" @operator "}" @operator) (table "{" @operator "}" @operator)
(comment) @comment (comment) @comment
(string) @string (string) @string

View file

@ -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)