mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 03:10:04 -04:00
feat(lua)!: switch from our fork to MunifTanjim's (#2272)
also take queries from https://github.com/MunifTanjim/nvim-treesitter-lua/tree/main/queries/lua BREAKING CHANGE: queries are not compatible; modules will have to update
This commit is contained in:
parent
668de0951a
commit
c80715f883
8 changed files with 189 additions and 206 deletions
|
|
@ -1,51 +1,51 @@
|
|||
;;; DECLARATIONS AND SCOPES
|
||||
; Scopes
|
||||
|
||||
;; Variable and field declarations
|
||||
((variable_declarator
|
||||
(identifier) @definition.var))
|
||||
|
||||
((variable_declarator
|
||||
(field_expression . (_) @definition.associated (property_identifier) @definition.var)))
|
||||
|
||||
;; Parameters
|
||||
(parameters (identifier) @definition.parameter)
|
||||
|
||||
;; Loops
|
||||
((loop_expression
|
||||
(identifier) @definition.var))
|
||||
|
||||
;; Function definitions
|
||||
((function
|
||||
(function_name
|
||||
(function_name_field
|
||||
(identifier) @definition.associated . (property_identifier) @definition.method)))
|
||||
(#set! definition.method.scope "parent"))
|
||||
|
||||
((function
|
||||
(function_name (identifier) @definition.function))
|
||||
(#set! definition.function.scope "parent"))
|
||||
|
||||
((local_function (identifier) @definition.function)
|
||||
(#set! definition.function.scope "parent"))
|
||||
|
||||
(local_variable_declaration
|
||||
(variable_declarator (identifier) @definition.function) . (function_definition))
|
||||
|
||||
;; Scopes
|
||||
[
|
||||
(program)
|
||||
(function)
|
||||
(local_function)
|
||||
(function_definition)
|
||||
(if_statement)
|
||||
(for_in_statement)
|
||||
(repeat_statement)
|
||||
(while_statement)
|
||||
(chunk)
|
||||
(do_statement)
|
||||
(while_statement)
|
||||
(repeat_statement)
|
||||
(if_statement)
|
||||
(for_statement)
|
||||
(function_declaration)
|
||||
(function_definition)
|
||||
] @scope
|
||||
|
||||
;;; REFERENCES
|
||||
; Definitions
|
||||
|
||||
(assignment_statement
|
||||
(variable_list
|
||||
(identifier) @definition.var))
|
||||
|
||||
(assignment_statement
|
||||
(variable_list
|
||||
(dot_index_expression . (_) @definition.associated (identifier) @definition.var)))
|
||||
|
||||
(function_declaration
|
||||
name: (identifier) @definition.function)
|
||||
(#set! definition.function.scope "parent")
|
||||
|
||||
(function_declaration
|
||||
name: (dot_index_expression
|
||||
. (_) @definition.associated (identifier) @definition.function))
|
||||
(#set! definition.method.scope "parent")
|
||||
|
||||
(function_declaration
|
||||
name: (method_index_expression
|
||||
. (_) @definition.associated (identifier) @definition.method))
|
||||
(#set! definition.method.scope "parent")
|
||||
|
||||
(for_generic_clause
|
||||
(variable_list
|
||||
(identifier) @definition.var))
|
||||
|
||||
(for_numeric_clause
|
||||
name: (identifier) @definition.var)
|
||||
|
||||
(parameters (identifier) @definition.parameter)
|
||||
|
||||
; References
|
||||
|
||||
[
|
||||
(identifier)
|
||||
(property_identifier)
|
||||
] @reference
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue