chore: query formatting

This commit is contained in:
Pham Huy Hoang 2024-01-06 15:05:50 +09:00 committed by Christian Clason
parent 79975d6557
commit 57a8acf0c4
674 changed files with 18466 additions and 12648 deletions

View file

@ -6,20 +6,14 @@
(resource_declaration)
(type_declaration)
(variable_declaration)
(parenthesized_expression)
(decorators)
(array)
(object)
(if_statement)
(for_statement)
(subscript_expression)
(ternary_expression)
(string)
(comment)
] @fold

View file

@ -1,5 +1,4 @@
; Includes
(import_statement
"import" @keyword.import)
@ -8,12 +7,10 @@
"with" @keyword.import)
; Namespaces
(module_declaration
(identifier) @module)
; Builtins
(primitive_type) @type.builtin
((member_expression
@ -21,12 +18,10 @@
(#eq? @type.builtin "sys"))
; Functions
(call_expression
function: (identifier) @function.call)
; Properties
(object_property
(identifier) @property
":" @punctuation.delimiter
@ -40,21 +35,20 @@
(property_identifier) @property
; Attributes
(decorator
"@" @attribute)
(decorator
(call_expression (identifier) @attribute))
(call_expression
(identifier) @attribute))
(decorator
(call_expression
(member_expression
object: (identifier) @attribute
property: (property_identifier) @attribute)))
object: (identifier) @attribute
property: (property_identifier) @attribute)))
; Types
(type_declaration
(identifier) @type)
@ -66,7 +60,8 @@
(type_declaration
(identifier)
"="
(array_type (identifier) @type))
(array_type
(identifier) @type))
(type
(identifier) @type)
@ -78,21 +73,22 @@
(identifier) @type)
; Parameters
(parameter_declaration
(identifier) @variable.parameter
(_))
(call_expression
function: (_)
(arguments (identifier) @variable.parameter))
function: (_)
(arguments
(identifier) @variable.parameter))
(call_expression
function: (_)
(arguments (member_expression object: (identifier) @variable.parameter)))
function: (_)
(arguments
(member_expression
object: (identifier) @variable.parameter)))
; Variables
(variable_declaration
(identifier) @variable
(_))
@ -117,7 +113,6 @@
(loop_enumerator) @variable))
; Conditionals
"if" @keyword.conditional
(ternary_expression
@ -125,14 +120,12 @@
":" @keyword.conditional.ternary)
; Loops
(for_statement
"for" @keyword.repeat
"in"
":" @punctuation.delimiter)
; Keywords
[
"module"
"metadata"
@ -146,7 +139,6 @@
] @keyword
; Operators
[
"+"
"-"
@ -169,14 +161,11 @@
"!"
] @operator
[
"in"
] @keyword.operator
"in" @keyword.operator
; Literals
(string) @string
(import_string
"'" @string
(import_name) @module
@ -192,17 +181,25 @@
(null) @constant.builtin
; Misc
(compatible_identifier
"?" @punctuation.special)
(nullable_return_type) @punctuation.special
["{" "}"] @punctuation.bracket
[
"{"
"}"
] @punctuation.bracket
["[" "]"] @punctuation.bracket
[
"["
"]"
] @punctuation.bracket
["(" ")"] @punctuation.bracket
[
"("
")"
] @punctuation.bracket
[
"."
@ -210,9 +207,7 @@
"=>"
] @punctuation.delimiter
; Interpolation
(interpolation) @none
(interpolation
@ -223,7 +218,6 @@
(identifier) @variable)
; Comments
[
(comment)
(diagnostic_comment)

View file

@ -5,11 +5,20 @@
"}" @indent.end
[ "{" "}" ] @indent.branch
[
"{"
"}"
] @indent.branch
[ "[" "]" ] @indent.branch
[
"["
"]"
] @indent.branch
[ "(" ")" ] @indent.branch
[
"("
")"
] @indent.branch
[
(ERROR)

View file

@ -1,5 +1,5 @@
([
(comment)
(diagnostic_comment)
] @injection.content
(#set! injection.language "comment"))
] @injection.content
(#set! injection.language "comment"))

View file

@ -1,22 +1,17 @@
; Scopes
[
(infrastructure)
(call_expression)
(lambda_expression)
(subscript_expression)
(if_statement)
(for_statement)
(array)
(object)
(interpolation)
] @local.scope
; References
(property_identifier) @local.reference
(call_expression
@ -31,7 +26,6 @@
(identifier) @local.reference)
; Definitions
(type) @local.definition.associated
(object_property