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

@ -1,37 +1,38 @@
(variable_identifier) @variable
(constant_identifier) @constant
[
"assert"
"assert_eq"
"assert_neq"
"block"
"console"
"const"
"let"
"mapping"
"program"
"record"
"self"
"struct"
"then"
"assert"
"assert_eq"
"assert_neq"
"block"
"console"
"const"
"let"
"mapping"
"program"
"record"
"self"
"struct"
"then"
] @keyword
"in" @keyword.operator
"in" @keyword.operator
[
"constant"
"private"
"public"
] @type.qualifier
"constant"
"private"
"public"
] @type.qualifier
"self" @variable.builtin
[
"finalize"
"function"
"inline"
"transition"
"finalize"
"function"
"inline"
"transition"
] @keyword.function
"import" @keyword.import
@ -42,86 +43,86 @@
"for" @keyword.repeat
[
[
"else"
"if"
] @keyword.conditional
[
(ternary_if)
(ternary_else)
(ternary_if)
(ternary_else)
] @keyword.conditional.ternary
[ "(" ")" "{" "}" "[" "]" ] @punctuation.bracket
[ ";" "," "::"] @punctuation.delimiter
[
"("
")"
"{"
"}"
"["
"]"
] @punctuation.bracket
[
"!"
"&&"
"||"
"=="
"!="
"<"
"<="
">"
">="
"&"
"|"
"^"
"<<"
">>"
"+"
"-"
"*"
"/"
"%"
"**"
"="
"+="
"-="
"*="
"/="
"%="
"**="
"<<="
">>="
"&="
"|="
"^="
"&&="
"||="
";"
","
"::"
] @punctuation.delimiter
[
"!"
"&&"
"||"
"=="
"!="
"<"
"<="
">"
">="
"&"
"|"
"^"
"<<"
">>"
"+"
"-"
"*"
"/"
"%"
"**"
"="
"+="
"-="
"*="
"/="
"%="
"**="
"<<="
">>="
"&="
"|="
"^="
"&&="
"||="
] @operator
(comment) @comment @spell
(boolean_literal) @boolean
(constant_declaration
(constant_declaration
(identifier) @constant)
[
(program_id)
(this_program_id)
(program_id)
(this_program_id)
] @string.special
;record declaration
(record_declaration (identifier) @variable.member)
(record_declaration
(identifier) @variable.member)
;struct component
(struct_component_declaration
;struct component
(struct_component_declaration
(identifier) @variable.member)
(type) @type
@ -129,18 +130,18 @@
(associated_constant) @constant
[
(block_height)
(self_caller)
(self_signer)
(block_height)
(self_caller)
(self_signer)
] @constant.builtin
(free_function_call
(locator
(identifier) @function))
(locator
(identifier) @function))
(record_type
(locator
(identifier) @variable.member))
(locator
(identifier) @variable.member))
(transition_declaration
name: (identifier) @function.builtin)
@ -158,28 +159,31 @@
name: (identifier) @function.macro)
(method_call
. (_)
. (identifier) @function.method.call)
.
(_)
.
(identifier) @function.method.call)
(function_parameter
(identifier) @variable.parameter)
(identifier) @variable.parameter)
(struct_declaration
name: (identifier) @variable.member)
(variable_declaration
(identifier_or_identifiers
(identifier) @variable))
(identifier_or_identifiers
(identifier) @variable))
[
[
(address_literal)
(signature_literal)
((affine_group_literal) (#set! "priority" 101))
(field_literal)
(product_group_literal)
(scalar_literal)
(signed_literal)
(unsigned_literal)
((affine_group_literal)
(#set! "priority" 101))
(field_literal)
(product_group_literal)
(scalar_literal)
(signed_literal)
(unsigned_literal)
] @number
(annotation) @attribute

View file

@ -1,33 +1,33 @@
[
(record_declaration)
(struct_declaration)
(mapping_declaration)
(constant_declaration)
(return_statement)
(expression_statement)
(variable_declaration)
(loop_statement)
(assignment_statement)
(assert_statement)
(struct_expression)
(array_expression)
(tuple_expression)
(parenthesized_expression)
(items_block)
(block)
(record_declaration)
(struct_declaration)
(mapping_declaration)
(constant_declaration)
(return_statement)
(expression_statement)
(variable_declaration)
(loop_statement)
(assignment_statement)
(assert_statement)
(struct_expression)
(array_expression)
(tuple_expression)
(parenthesized_expression)
(items_block)
(block)
] @indent.begin
; if "if" statement and conditional statement are in separate lines
; conditional should be indented and when the conditional block
; if "if" statement and conditional statement are in separate lines
; conditional should be indented and when the conditional block
; starts dedented
(branch
(block "{" @indent.end)) @indent.begin
(block
"{" @indent.end)) @indent.begin
((function_parameters) @indent.align
(#set! indent.open_delimiter "(")
(#set! indent.close_delimiter ")"))
[
(comment)
(ERROR)
(comment)
(ERROR)
] @indent.auto

View file

@ -1,2 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
(#set! injection.language "comment"))