diff options
| author | Thomas Vigouroux <39092278+vigoux@users.noreply.github.com> | 2020-04-23 10:31:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-23 10:31:02 +0200 |
| commit | 931c2c67ce12bbf5572bad6c665e173426d02200 (patch) | |
| tree | be7b3981cba846884f9aea923c0266fd0af7efba /queries/lua | |
| parent | ee5e88dca242a3c9143b69af5811f5152175f574 (diff) | |
| parent | f6f402e8707549fe9e84caa883c33ad64790d242 (diff) | |
Merge pull request #22 from vigoux/fix/lua-locals-highlights
Fix lua queries
Diffstat (limited to 'queries/lua')
| -rw-r--r-- | queries/lua/highlights.scm | 1 | ||||
| -rw-r--r-- | queries/lua/locals.scm | 19 |
2 files changed, 12 insertions, 8 deletions
diff --git a/queries/lua/highlights.scm b/queries/lua/highlights.scm index 4ce331fa..3077be10 100644 --- a/queries/lua/highlights.scm +++ b/queries/lua/highlights.scm @@ -50,6 +50,7 @@ ;; Nodes (function "function" @function "end" @function) +(local_function "function" @function "end" @function) (table "{" @operator "}" @operator) (comment) @comment (string) @string diff --git a/queries/lua/locals.scm b/queries/lua/locals.scm index 4764c021..5f21e0aa 100644 --- a/queries/lua/locals.scm +++ b/queries/lua/locals.scm @@ -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) |
