diff options
| author | Thomas Vigouroux <39092278+vigoux@users.noreply.github.com> | 2020-04-19 20:38:51 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-19 20:38:51 +0200 |
| commit | 05be31024adc868af782c51dd63c6ccdfbfeb2a9 (patch) | |
| tree | 45970745e65c16d52bcb93db4a4a466c6f9f105c /queries/lua | |
| parent | Merge pull request #2 from kyazdani42/install-parser (diff) | |
| parent | perf: don't compute locals on buffer updates (diff) | |
| download | nvim-treesitter-05be31024adc868af782c51dd63c6ccdfbfeb2a9.tar nvim-treesitter-05be31024adc868af782c51dd63c6ccdfbfeb2a9.tar.gz nvim-treesitter-05be31024adc868af782c51dd63c6ccdfbfeb2a9.tar.bz2 nvim-treesitter-05be31024adc868af782c51dd63c6ccdfbfeb2a9.tar.lz nvim-treesitter-05be31024adc868af782c51dd63c6ccdfbfeb2a9.tar.xz nvim-treesitter-05be31024adc868af782c51dd63c6ccdfbfeb2a9.tar.zst nvim-treesitter-05be31024adc868af782c51dd63c6ccdfbfeb2a9.zip | |
Merge pull request #3 from vigoux/feature/locals
Add locals handling
Diffstat (limited to 'queries/lua')
| -rw-r--r-- | queries/lua/locals.scm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/queries/lua/locals.scm b/queries/lua/locals.scm index a7b15d1e5..4764c021c 100644 --- a/queries/lua/locals.scm +++ b/queries/lua/locals.scm @@ -3,19 +3,19 @@ ;; Variable and field declarations ((variable_declarator (identifier) @definition) - (set! kind "v")) + (set! definition.kind "v")) ((variable_declarator (field_expression object:(*) @definition.associated (property_identifier) @definition)) - (set! kind "v")) + (set! difinition.kind "v")) ;; Parameters ((local_function (parameters (identifier) @definition)) - (set! kind "v")) + (set! definition.kind "v")) ((function (parameters (identifier) @definition)) - (set! kind "v")) + (set! definition.kind "v")) ;; Function definitions ;; Functions definitions creates both a definition and a new scope @@ -23,15 +23,15 @@ (function_name_field object: (identifier) @definition.associated (property_identifier) @definition)) @scope - (set! kind "m")) + (set! definition.kind "m")) ((function (function_name (identifier) @definition)) @scope - (set! kind "f")) + (set! definition.kind "f")) ((local_function (identifier) @definition) @scope - (set! kind "f")) + (set! definition.kind "f")) ((if_statement) @scope) ((for_in_statement) @scope) @@ -39,7 +39,7 @@ ;; Loops ((loop_expression (identifier) @definition) - (set! kind "v")) + (set! definition.kind "v")) ;;; REFERENCES ((identifier) @reference) |
