mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-16 02:10:15 -04:00
chore: query formatting
This commit is contained in:
parent
79975d6557
commit
57a8acf0c4
674 changed files with 18466 additions and 12648 deletions
|
|
@ -1,5 +1,4 @@
|
|||
;; Scopes
|
||||
|
||||
; Scopes
|
||||
[
|
||||
(if_statement)
|
||||
(elif_clause)
|
||||
|
|
@ -16,77 +15,107 @@
|
|||
(set_body)
|
||||
] @local.scope
|
||||
|
||||
;; Parameters
|
||||
; Parameters
|
||||
(parameters
|
||||
(identifier) @local.definition.parameter)
|
||||
|
||||
(parameters (identifier) @local.definition.parameter)
|
||||
(default_parameter (identifier) @local.definition.parameter)
|
||||
(typed_parameter (identifier) @local.definition.parameter)
|
||||
(typed_default_parameter (identifier) @local.definition.parameter)
|
||||
(default_parameter
|
||||
(identifier) @local.definition.parameter)
|
||||
|
||||
;; Signals
|
||||
(typed_parameter
|
||||
(identifier) @local.definition.parameter)
|
||||
|
||||
(typed_default_parameter
|
||||
(identifier) @local.definition.parameter)
|
||||
|
||||
; Signals
|
||||
; Can gdscript 2 signals be considered fields?
|
||||
(signal_statement (name) @local.definition.field)
|
||||
(signal_statement
|
||||
(name) @local.definition.field)
|
||||
|
||||
;; Variable Definitions
|
||||
; Variable Definitions
|
||||
(const_statement
|
||||
(name) @local.definition.constant)
|
||||
|
||||
(const_statement (name) @local.definition.constant)
|
||||
; onready and export variations are only properties.
|
||||
(variable_statement (name) @local.definition.var)
|
||||
(variable_statement
|
||||
(name) @local.definition.var)
|
||||
|
||||
(setter) @local.reference
|
||||
|
||||
(getter) @local.reference
|
||||
|
||||
;; Function Definition
|
||||
|
||||
((function_definition (name) @local.definition.function)
|
||||
(#set! "definition.function.scope" "parent"))
|
||||
|
||||
;; Lambda
|
||||
; Function Definition
|
||||
((function_definition
|
||||
(name) @local.definition.function)
|
||||
(#set! "definition.function.scope" "parent"))
|
||||
|
||||
; Lambda
|
||||
; lambda names are not accessible and are only for debugging.
|
||||
(lambda (name) @local.definition.function)
|
||||
(lambda
|
||||
(name) @local.definition.function)
|
||||
|
||||
;; Source
|
||||
; Source
|
||||
(class_name_statement
|
||||
(name) @local.definition.type)
|
||||
|
||||
(class_name_statement (name) @local.definition.type)
|
||||
(source
|
||||
(variable_statement
|
||||
(name) @local.definition.field))
|
||||
|
||||
(source (variable_statement (name) @local.definition.field))
|
||||
(source (onready_variable_statement (name) @local.definition.field))
|
||||
(source (export_variable_statement (name) @local.definition.field))
|
||||
(source
|
||||
(onready_variable_statement
|
||||
(name) @local.definition.field))
|
||||
|
||||
;; Class
|
||||
(source
|
||||
(export_variable_statement
|
||||
(name) @local.definition.field))
|
||||
|
||||
((class_definition (name) @local.definition.type)
|
||||
(#set! "definition.type.scope" "parent"))
|
||||
; Class
|
||||
((class_definition
|
||||
(name) @local.definition.type)
|
||||
(#set! "definition.type.scope" "parent"))
|
||||
|
||||
(class_definition
|
||||
(body (variable_statement (name) @local.definition.field)))
|
||||
(body
|
||||
(variable_statement
|
||||
(name) @local.definition.field)))
|
||||
|
||||
(class_definition
|
||||
(body (onready_variable_statement (name) @local.definition.field)))
|
||||
(body
|
||||
(onready_variable_statement
|
||||
(name) @local.definition.field)))
|
||||
|
||||
(class_definition
|
||||
(body (export_variable_statement (name) @local.definition.field)))
|
||||
(body
|
||||
(export_variable_statement
|
||||
(name) @local.definition.field)))
|
||||
|
||||
(class_definition
|
||||
(body (signal_statement (name) @local.definition.field)))
|
||||
(body
|
||||
(signal_statement
|
||||
(name) @local.definition.field)))
|
||||
|
||||
; Although a script is also a class, let's only define functions in an inner class as
|
||||
; methods.
|
||||
((class_definition
|
||||
(body (function_definition (name) @local.definition.method)))
|
||||
(#set! "definition.method.scope" "parent"))
|
||||
(body
|
||||
(function_definition
|
||||
(name) @local.definition.method)))
|
||||
(#set! "definition.method.scope" "parent"))
|
||||
|
||||
;; Enum
|
||||
; Enum
|
||||
((enum_definition
|
||||
(name) @local.definition.enum))
|
||||
|
||||
((enum_definition (name) @local.definition.enum))
|
||||
; Repeat
|
||||
(for_statement
|
||||
.
|
||||
(identifier) @local.definition.var)
|
||||
|
||||
;; Repeat
|
||||
|
||||
(for_statement . (identifier) @local.definition.var)
|
||||
|
||||
;; Match Statement
|
||||
|
||||
(pattern_binding (identifier) @local.definition.var)
|
||||
|
||||
;; References
|
||||
; Match Statement
|
||||
(pattern_binding
|
||||
(identifier) @local.definition.var)
|
||||
|
||||
; References
|
||||
(identifier) @local.reference
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue