mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-13 17:00:09 -04:00
chore: query formatting
This commit is contained in:
parent
79975d6557
commit
57a8acf0c4
674 changed files with 18466 additions and 12648 deletions
|
|
@ -1,17 +1,17 @@
|
|||
; Variables
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
; Includes
|
||||
|
||||
"include" @keyword.import
|
||||
|
||||
(include_statement (identifier) @type)
|
||||
(include_statement
|
||||
(identifier) @type)
|
||||
|
||||
(include_statement (class_identifier (identifier) @type . ))
|
||||
(include_statement
|
||||
(class_identifier
|
||||
(identifier) @type .))
|
||||
|
||||
; Keywords
|
||||
|
||||
[
|
||||
"class"
|
||||
"inherits"
|
||||
|
|
@ -33,68 +33,99 @@
|
|||
"case"
|
||||
] @keyword.conditional
|
||||
|
||||
(default_case "default" @keyword.conditional)
|
||||
(default_case
|
||||
"default" @keyword.conditional)
|
||||
|
||||
; Properties
|
||||
(attribute
|
||||
name: (identifier) @property)
|
||||
|
||||
(attribute name: (identifier) @property)
|
||||
(attribute name: (variable (identifier) @property))
|
||||
(attribute
|
||||
name:
|
||||
(variable
|
||||
(identifier) @property))
|
||||
|
||||
; Parameters
|
||||
(lambda
|
||||
(variable
|
||||
(identifier) @variable.parameter))
|
||||
|
||||
(lambda (variable (identifier) @variable.parameter))
|
||||
|
||||
(parameter (variable (identifier) @variable.parameter))
|
||||
|
||||
(function_call (identifier) @variable.parameter)
|
||||
|
||||
(method_call (identifier) @variable.parameter)
|
||||
|
||||
; Functions
|
||||
|
||||
(function_declaration
|
||||
"function" . (identifier) @function)
|
||||
(parameter
|
||||
(variable
|
||||
(identifier) @variable.parameter))
|
||||
|
||||
(function_call
|
||||
(identifier) @function.call "(")
|
||||
|
||||
(defined_resource_type
|
||||
"define" . (identifier) @function)
|
||||
|
||||
; Methods
|
||||
|
||||
(function_declaration
|
||||
"function" . (class_identifier (identifier) @function.method . ))
|
||||
|
||||
(function_call
|
||||
(class_identifier (identifier) @function.method.call . ))
|
||||
|
||||
(defined_resource_type
|
||||
"define" . (class_identifier (identifier) @function.method . ))
|
||||
(identifier) @variable.parameter)
|
||||
|
||||
(method_call
|
||||
"." . (identifier) @function.method.call)
|
||||
(identifier) @variable.parameter)
|
||||
|
||||
; Functions
|
||||
(function_declaration
|
||||
"function"
|
||||
.
|
||||
(identifier) @function)
|
||||
|
||||
(function_call
|
||||
(identifier) @function.call
|
||||
"(")
|
||||
|
||||
(defined_resource_type
|
||||
"define"
|
||||
.
|
||||
(identifier) @function)
|
||||
|
||||
; Methods
|
||||
(function_declaration
|
||||
"function"
|
||||
.
|
||||
(class_identifier
|
||||
(identifier) @function.method .))
|
||||
|
||||
(function_call
|
||||
(class_identifier
|
||||
(identifier) @function.method.call .))
|
||||
|
||||
(defined_resource_type
|
||||
"define"
|
||||
.
|
||||
(class_identifier
|
||||
(identifier) @function.method .))
|
||||
|
||||
(method_call
|
||||
"."
|
||||
.
|
||||
(identifier) @function.method.call)
|
||||
|
||||
; Types
|
||||
|
||||
(type) @type
|
||||
|
||||
(builtin_type) @type.builtin
|
||||
|
||||
(class_definition
|
||||
(identifier) @type)
|
||||
(class_definition
|
||||
(class_identifier (identifier) @type . ))
|
||||
|
||||
(class_inherits (identifier) @type)
|
||||
(class_inherits (class_identifier (identifier) @type . ))
|
||||
(class_definition
|
||||
(class_identifier
|
||||
(identifier) @type .))
|
||||
|
||||
(class_inherits
|
||||
(identifier) @type)
|
||||
|
||||
(class_inherits
|
||||
(class_identifier
|
||||
(identifier) @type .))
|
||||
|
||||
(resource_declaration
|
||||
(identifier) @type)
|
||||
(resource_declaration
|
||||
(class_identifier (identifier) @type . ))
|
||||
|
||||
(node_definition (node_name (identifier) @type))
|
||||
(resource_declaration
|
||||
(class_identifier
|
||||
(identifier) @type .))
|
||||
|
||||
(node_definition
|
||||
(node_name
|
||||
(identifier) @type))
|
||||
|
||||
((identifier) @type
|
||||
(#lua-match? @type "^[A-Z]"))
|
||||
|
|
@ -103,11 +134,11 @@
|
|||
(#any-of? @type.builtin "Boolean" "Integer" "Float" "String" "Array" "Hash" "Regexp" "Variant" "Data" "Undef" "Default" "File"))
|
||||
|
||||
; "Namespaces"
|
||||
|
||||
(class_identifier . (identifier) @module)
|
||||
(class_identifier
|
||||
.
|
||||
(identifier) @module)
|
||||
|
||||
; Operators
|
||||
|
||||
[
|
||||
"or"
|
||||
"and"
|
||||
|
|
@ -142,7 +173,6 @@
|
|||
] @operator
|
||||
|
||||
; Punctuation
|
||||
|
||||
[
|
||||
"|"
|
||||
"."
|
||||
|
|
@ -153,13 +183,26 @@
|
|||
"=>"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[ "{" "}" ] @punctuation.bracket
|
||||
[
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
[ "[" "]" ] @punctuation.bracket
|
||||
[
|
||||
"["
|
||||
"]"
|
||||
] @punctuation.bracket
|
||||
|
||||
[ "(" ")" ] @punctuation.bracket
|
||||
[
|
||||
"("
|
||||
")"
|
||||
] @punctuation.bracket
|
||||
|
||||
(interpolation [ "${" "}" ] @punctuation.special)
|
||||
(interpolation
|
||||
[
|
||||
"${"
|
||||
"}"
|
||||
] @punctuation.special)
|
||||
|
||||
[
|
||||
"$"
|
||||
|
|
@ -168,7 +211,6 @@
|
|||
] @punctuation.special
|
||||
|
||||
; Literals
|
||||
|
||||
(number) @number
|
||||
|
||||
(float) @number.float
|
||||
|
|
@ -187,5 +229,4 @@
|
|||
] @variable.builtin
|
||||
|
||||
; Comments
|
||||
|
||||
(comment) @comment @spell
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
; Scopes
|
||||
|
||||
[
|
||||
(block)
|
||||
(defined_resource_type)
|
||||
|
|
@ -16,31 +15,50 @@
|
|||
] @local.scope
|
||||
|
||||
; References
|
||||
|
||||
[
|
||||
(identifier)
|
||||
(class_identifier)
|
||||
(variable)
|
||||
(variable)
|
||||
] @local.reference
|
||||
|
||||
; Definitions
|
||||
|
||||
(attribute [(identifier) (variable)] @local.definition.field)
|
||||
(attribute
|
||||
[
|
||||
(identifier)
|
||||
(variable)
|
||||
] @local.definition.field)
|
||||
|
||||
(function_declaration
|
||||
[(identifier) (class_identifier)] @local.definition.function)
|
||||
[
|
||||
(identifier)
|
||||
(class_identifier)
|
||||
] @local.definition.function)
|
||||
|
||||
(include_statement [(identifier) (class_identifier)] @local.definition.import)
|
||||
(include_statement
|
||||
[
|
||||
(identifier)
|
||||
(class_identifier)
|
||||
] @local.definition.import)
|
||||
|
||||
(parameter (variable) @local.definition.parameter)
|
||||
(parameter
|
||||
(variable) @local.definition.parameter)
|
||||
|
||||
(class_definition
|
||||
[(identifier) (class_identifier)] @local.definition.type)
|
||||
[
|
||||
(identifier)
|
||||
(class_identifier)
|
||||
] @local.definition.type)
|
||||
|
||||
(node_definition
|
||||
(node_name (identifier) @local.definition.type))
|
||||
(node_name
|
||||
(identifier) @local.definition.type))
|
||||
|
||||
(resource_declaration
|
||||
[(identifier) (class_identifier)] @local.definition.type)
|
||||
[
|
||||
(identifier)
|
||||
(class_identifier)
|
||||
] @local.definition.type)
|
||||
|
||||
(assignment . (variable) @local.definition.var)
|
||||
(assignment
|
||||
.
|
||||
(variable) @local.definition.var)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue