mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat!: drop modules, general refactor and cleanup
This commit is contained in:
parent
310f0925ec
commit
692b051b09
1247 changed files with 6096 additions and 9074 deletions
225
runtime/queries/leo/highlights.scm
Normal file
225
runtime/queries/leo/highlights.scm
Normal file
|
|
@ -0,0 +1,225 @@
|
|||
[
|
||||
"assert"
|
||||
"assert_eq"
|
||||
"assert_neq"
|
||||
"block"
|
||||
"console"
|
||||
"const"
|
||||
"let"
|
||||
"mapping"
|
||||
"program"
|
||||
"self"
|
||||
"then"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"record"
|
||||
"struct"
|
||||
] @keyword.type
|
||||
|
||||
[
|
||||
"in"
|
||||
"as"
|
||||
] @keyword.operator
|
||||
|
||||
[
|
||||
"constant"
|
||||
"private"
|
||||
"public"
|
||||
] @keyword.modifier
|
||||
|
||||
"self" @variable.builtin
|
||||
|
||||
"network" @variable.builtin
|
||||
|
||||
"async" @keyword.coroutine
|
||||
|
||||
[
|
||||
"finalize"
|
||||
"function"
|
||||
"inline"
|
||||
"transition"
|
||||
] @keyword.function
|
||||
|
||||
"import" @keyword.import
|
||||
|
||||
"return" @keyword.return
|
||||
|
||||
(return_arrow) @punctuation.delimiter
|
||||
|
||||
"for" @keyword.repeat
|
||||
|
||||
[
|
||||
"else"
|
||||
"if"
|
||||
] @keyword.conditional
|
||||
|
||||
[
|
||||
(ternary_if)
|
||||
(ternary_else)
|
||||
] @keyword.conditional.ternary
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"{"
|
||||
"}"
|
||||
"["
|
||||
"]"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
";"
|
||||
","
|
||||
"::"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"!"
|
||||
"&&"
|
||||
"||"
|
||||
"=="
|
||||
"!="
|
||||
"<"
|
||||
"<="
|
||||
">"
|
||||
">="
|
||||
"&"
|
||||
"|"
|
||||
"^"
|
||||
"<<"
|
||||
">>"
|
||||
"+"
|
||||
"-"
|
||||
"*"
|
||||
"/"
|
||||
"%"
|
||||
"**"
|
||||
"="
|
||||
"+="
|
||||
"-="
|
||||
"*="
|
||||
"/="
|
||||
"%="
|
||||
"**="
|
||||
"<<="
|
||||
">>="
|
||||
"&="
|
||||
"|="
|
||||
"^="
|
||||
"&&="
|
||||
"||="
|
||||
] @operator
|
||||
|
||||
(comment) @comment @spell
|
||||
|
||||
(boolean_literal) @boolean
|
||||
|
||||
(constant_declaration
|
||||
(identifier
|
||||
(constant_identifier) @constant))
|
||||
|
||||
(variable
|
||||
(constant_identifier) @constant)
|
||||
|
||||
(associated_constant) @constant
|
||||
|
||||
(variable) @variable
|
||||
|
||||
(program_id) @string.special
|
||||
|
||||
;record declaration
|
||||
(record_declaration
|
||||
(identifier) @type.definition)
|
||||
|
||||
;struct component
|
||||
(struct_component_declaration
|
||||
(identifier) @variable.member)
|
||||
|
||||
(struct_expression
|
||||
(identifier) @type.definition)
|
||||
|
||||
(struct_component_initializer
|
||||
(identifier) @variable.member)
|
||||
|
||||
[
|
||||
(type)
|
||||
(boolean_type)
|
||||
(integer_type)
|
||||
(field_type)
|
||||
(group_type)
|
||||
(scalar_type)
|
||||
(address_type)
|
||||
(signature_type)
|
||||
(string_type)
|
||||
] @type
|
||||
|
||||
[
|
||||
(block_height)
|
||||
(self_address)
|
||||
(self_caller)
|
||||
(self_signer)
|
||||
(network_id)
|
||||
] @constant.builtin
|
||||
|
||||
(free_function_call
|
||||
(locator
|
||||
(identifier) @function))
|
||||
|
||||
(associated_function_call
|
||||
(named_type
|
||||
(identifier
|
||||
(constant_identifier) @function)))
|
||||
|
||||
(associated_function_call
|
||||
(identifier) @function.call)
|
||||
|
||||
(record_type
|
||||
(locator
|
||||
(identifier) @variable.member))
|
||||
|
||||
(transition_declaration
|
||||
name: (identifier) @function.builtin)
|
||||
|
||||
(finalizer
|
||||
name: (identifier) @function.builtin)
|
||||
|
||||
(free_function_call
|
||||
(identifier) @function.call)
|
||||
|
||||
(function_declaration
|
||||
name: (identifier) @function)
|
||||
|
||||
(inline_declaration
|
||||
name: (identifier) @function.macro)
|
||||
|
||||
(method_call
|
||||
.
|
||||
(_)
|
||||
.
|
||||
(identifier) @function.method.call)
|
||||
|
||||
(function_parameter
|
||||
(identifier) @variable.parameter)
|
||||
|
||||
(struct_declaration
|
||||
name: (identifier) @type.definition)
|
||||
|
||||
(variable_declaration
|
||||
(identifier) @variable)
|
||||
|
||||
[
|
||||
(address_literal)
|
||||
(signature_literal)
|
||||
((affine_group_literal)
|
||||
(#set! priority 101))
|
||||
(field_literal)
|
||||
(product_group_literal)
|
||||
(scalar_literal)
|
||||
(signed_literal)
|
||||
(unsigned_literal)
|
||||
] @number
|
||||
|
||||
(string_literal) @string
|
||||
|
||||
(annotation) @attribute
|
||||
61
runtime/queries/leo/indents.scm
Normal file
61
runtime/queries/leo/indents.scm
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
[
|
||||
(array_expression)
|
||||
(assert_statement)
|
||||
(assignment_statement)
|
||||
(block)
|
||||
(constant_declaration)
|
||||
(expression_statement)
|
||||
(items_block)
|
||||
(loop_statement)
|
||||
(mapping_declaration)
|
||||
(parenthesized_expression)
|
||||
(record_declaration)
|
||||
(return_statement)
|
||||
(struct_declaration)
|
||||
(struct_expression)
|
||||
(tuple_expression)
|
||||
(variable_declaration)
|
||||
] @indent.begin
|
||||
|
||||
((function_parameters) @indent.align
|
||||
(#set! indent.open_delimiter "(")
|
||||
(#set! indent.close_delimiter ")"))
|
||||
|
||||
((function_arguments) @indent.align
|
||||
(#set! indent.open_delimiter "(")
|
||||
(#set! indent.close_delimiter ")"))
|
||||
|
||||
(parenthesized_expression
|
||||
")" @indent.branch)
|
||||
|
||||
(function_parameters
|
||||
")" @indent.branch)
|
||||
|
||||
(function_arguments
|
||||
")" @indent.branch)
|
||||
|
||||
(record_declaration
|
||||
"}" @indent.branch)
|
||||
|
||||
(struct_declaration
|
||||
"}" @indent.branch)
|
||||
|
||||
(struct_expression
|
||||
"}" @indent.branch)
|
||||
|
||||
(array_expression
|
||||
"]" @indent.branch)
|
||||
|
||||
(tuple_expression
|
||||
")" @indent.branch)
|
||||
|
||||
(items_block
|
||||
"}" @indent.branch)
|
||||
|
||||
(block
|
||||
"}" @indent.branch)
|
||||
|
||||
[
|
||||
(comment)
|
||||
(ERROR)
|
||||
] @indent.auto
|
||||
2
runtime/queries/leo/injections.scm
Normal file
2
runtime/queries/leo/injections.scm
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue