mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-20 12:20:02 -04:00
chore: query formatting
This commit is contained in:
parent
79975d6557
commit
57a8acf0c4
674 changed files with 18466 additions and 12648 deletions
|
|
@ -1,11 +1,7 @@
|
|||
; Includes
|
||||
|
||||
[
|
||||
"use"
|
||||
] @keyword.import
|
||||
"use" @keyword.import
|
||||
|
||||
; Keywords
|
||||
|
||||
[
|
||||
"type"
|
||||
"actor"
|
||||
|
|
@ -25,25 +21,18 @@
|
|||
"where"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"fun"
|
||||
] @keyword.function
|
||||
"fun" @keyword.function
|
||||
|
||||
[
|
||||
"be"
|
||||
] @keyword.coroutine
|
||||
"be" @keyword.coroutine
|
||||
|
||||
[
|
||||
"in"
|
||||
"is"
|
||||
] @keyword.operator
|
||||
|
||||
[
|
||||
"return"
|
||||
] @keyword.return
|
||||
"return" @keyword.return
|
||||
|
||||
; Qualifiers
|
||||
|
||||
[
|
||||
"iso"
|
||||
"trn"
|
||||
|
|
@ -59,7 +48,6 @@
|
|||
] @type.qualifier
|
||||
|
||||
; Conditionals
|
||||
|
||||
[
|
||||
"if"
|
||||
"ifdef"
|
||||
|
|
@ -70,14 +58,16 @@
|
|||
"match"
|
||||
] @keyword.conditional
|
||||
|
||||
(if_statement "end" @keyword.conditional)
|
||||
(if_statement
|
||||
"end" @keyword.conditional)
|
||||
|
||||
(iftype_statement "end" @keyword.conditional)
|
||||
(iftype_statement
|
||||
"end" @keyword.conditional)
|
||||
|
||||
(match_statement "end" @keyword.conditional)
|
||||
(match_statement
|
||||
"end" @keyword.conditional)
|
||||
|
||||
; Repeats
|
||||
|
||||
[
|
||||
"repeat"
|
||||
"until"
|
||||
|
|
@ -88,86 +78,112 @@
|
|||
"break"
|
||||
] @keyword.repeat
|
||||
|
||||
(do_block "end" @keyword.repeat)
|
||||
(do_block
|
||||
"end" @keyword.repeat)
|
||||
|
||||
(repeat_statement "end" @keyword.repeat)
|
||||
(repeat_statement
|
||||
"end" @keyword.repeat)
|
||||
|
||||
; Exceptions
|
||||
|
||||
[
|
||||
"try"
|
||||
(error)
|
||||
"compile_error"
|
||||
] @keyword.exception
|
||||
|
||||
(try_statement "end" @keyword.exception)
|
||||
(try_statement
|
||||
"end" @keyword.exception)
|
||||
|
||||
(recover_statement "end" @keyword.exception)
|
||||
(recover_statement
|
||||
"end" @keyword.exception)
|
||||
|
||||
; Attributes
|
||||
|
||||
(annotation) @attribute
|
||||
|
||||
; Variables
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
(this) @variable.builtin
|
||||
|
||||
; Fields
|
||||
(field
|
||||
name: (identifier) @variable.member)
|
||||
|
||||
(field name: (identifier) @variable.member)
|
||||
|
||||
(member_expression "." (identifier) @variable.member)
|
||||
(member_expression
|
||||
"."
|
||||
(identifier) @variable.member)
|
||||
|
||||
; Constructors
|
||||
|
||||
(constructor "new" @keyword.operator (identifier) @constructor)
|
||||
(constructor
|
||||
"new" @keyword.operator
|
||||
(identifier) @constructor)
|
||||
|
||||
; Methods
|
||||
(method
|
||||
(identifier) @function.method)
|
||||
|
||||
(method (identifier) @function.method)
|
||||
(behavior
|
||||
(identifier) @function.method)
|
||||
|
||||
(behavior (identifier) @function.method)
|
||||
(ffi_method
|
||||
(identifier) @function.method)
|
||||
|
||||
(ffi_method (identifier) @function.method)
|
||||
|
||||
((ffi_method (string) @string.special)
|
||||
((ffi_method
|
||||
(string) @string.special)
|
||||
(#set! "priority" 105))
|
||||
|
||||
(call_expression
|
||||
callee:
|
||||
[
|
||||
(identifier) @function.method.call
|
||||
(ffi_identifier (identifier) @function.method.call)
|
||||
(member_expression "." (identifier) @function.method.call)
|
||||
(ffi_identifier
|
||||
(identifier) @function.method.call)
|
||||
(member_expression
|
||||
"."
|
||||
(identifier) @function.method.call)
|
||||
])
|
||||
|
||||
; Parameters
|
||||
(parameter
|
||||
name: (identifier) @variable.parameter)
|
||||
|
||||
(parameter name: (identifier) @variable.parameter)
|
||||
(lambda_parameter name: (identifier) @variable.parameter)
|
||||
(lambda_parameter
|
||||
name: (identifier) @variable.parameter)
|
||||
|
||||
; Types
|
||||
(type_alias
|
||||
(identifier) @type.definition)
|
||||
|
||||
(type_alias (identifier) @type.definition)
|
||||
(base_type
|
||||
name: (identifier) @type)
|
||||
|
||||
(base_type name: (identifier) @type)
|
||||
(generic_parameter
|
||||
(identifier) @type)
|
||||
|
||||
(generic_parameter (identifier) @type)
|
||||
|
||||
(lambda_type (identifier)? @function.method)
|
||||
(lambda_type
|
||||
(identifier)? @function.method)
|
||||
|
||||
((identifier) @type
|
||||
(#lua-match? @type "^_*[A-Z][a-zA-Z0-9_]*$"))
|
||||
|
||||
; Operators
|
||||
|
||||
(unary_expression
|
||||
operator: ["not" "addressof" "digestof"] @keyword.operator)
|
||||
operator:
|
||||
[
|
||||
"not"
|
||||
"addressof"
|
||||
"digestof"
|
||||
] @keyword.operator)
|
||||
|
||||
(binary_expression
|
||||
operator: ["and" "or" "xor" "is" "isnt"] @keyword.operator)
|
||||
operator:
|
||||
[
|
||||
"and"
|
||||
"or"
|
||||
"xor"
|
||||
"is"
|
||||
"isnt"
|
||||
] @keyword.operator)
|
||||
|
||||
[
|
||||
"="
|
||||
|
|
@ -213,35 +229,57 @@
|
|||
] @operator
|
||||
|
||||
; Literals
|
||||
|
||||
(string) @string
|
||||
|
||||
(source_file (string) @string.documentation)
|
||||
(actor_definition (string) @string.documentation)
|
||||
(class_definition (string) @string.documentation)
|
||||
(primitive_definition (string) @string.documentation)
|
||||
(interface_definition (string) @string.documentation)
|
||||
(trait_definition (string) @string.documentation)
|
||||
(struct_definition (string) @string.documentation)
|
||||
(type_alias (string) @string.documentation)
|
||||
(field (string) @string.documentation)
|
||||
(source_file
|
||||
(string) @string.documentation)
|
||||
|
||||
(actor_definition
|
||||
(string) @string.documentation)
|
||||
|
||||
(class_definition
|
||||
(string) @string.documentation)
|
||||
|
||||
(primitive_definition
|
||||
(string) @string.documentation)
|
||||
|
||||
(interface_definition
|
||||
(string) @string.documentation)
|
||||
|
||||
(trait_definition
|
||||
(string) @string.documentation)
|
||||
|
||||
(struct_definition
|
||||
(string) @string.documentation)
|
||||
|
||||
(type_alias
|
||||
(string) @string.documentation)
|
||||
|
||||
(field
|
||||
(string) @string.documentation)
|
||||
|
||||
(constructor
|
||||
[
|
||||
(string) @string.documentation
|
||||
(block . (string) @string.documentation)
|
||||
(string) @string.documentation
|
||||
(block
|
||||
.
|
||||
(string) @string.documentation)
|
||||
])
|
||||
|
||||
(method
|
||||
[
|
||||
(string) @string.documentation
|
||||
(block . (string) @string.documentation)
|
||||
(string) @string.documentation
|
||||
(block
|
||||
.
|
||||
(string) @string.documentation)
|
||||
])
|
||||
|
||||
(behavior
|
||||
[
|
||||
(string) @string.documentation
|
||||
(block . (string) @string.documentation)
|
||||
(string) @string.documentation
|
||||
(block
|
||||
.
|
||||
(string) @string.documentation)
|
||||
])
|
||||
|
||||
(character) @character
|
||||
|
|
@ -255,12 +293,20 @@
|
|||
(boolean) @boolean
|
||||
|
||||
; Punctuation
|
||||
[
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
[ "{" "}" ] @punctuation.bracket
|
||||
[
|
||||
"["
|
||||
"]"
|
||||
] @punctuation.bracket
|
||||
|
||||
[ "[" "]" ] @punctuation.bracket
|
||||
|
||||
[ "(" ")" ] @punctuation.bracket
|
||||
[
|
||||
"("
|
||||
")"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
"."
|
||||
|
|
@ -281,7 +327,6 @@
|
|||
] @punctuation.special
|
||||
|
||||
; Comments
|
||||
|
||||
[
|
||||
(line_comment)
|
||||
(block_comment)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue