Update generated neovim config
This commit is contained in:
@ -0,0 +1,226 @@
|
||||
; NOTE: Order of highlight queries matters, as Tree-sitter uses last-wins strategy
|
||||
; NOTE: Therefore, narrow highlight queries should be placed after broad captures.
|
||||
; --------------------------------------------------------------------------------
|
||||
|
||||
; variable
|
||||
; --------
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
; variable.builtin
|
||||
; ----------------
|
||||
|
||||
(self) @variable.builtin
|
||||
|
||||
; variable.parameter
|
||||
; ------------------
|
||||
|
||||
(parameter
|
||||
name: (identifier) @variable.parameter)
|
||||
|
||||
; punctuation.delimiter
|
||||
; ---------------------
|
||||
|
||||
[
|
||||
";"
|
||||
","
|
||||
"."
|
||||
":"
|
||||
"?"
|
||||
] @punctuation.delimiter
|
||||
|
||||
; punctuation.bracket
|
||||
; -------------------
|
||||
|
||||
[
|
||||
"(" ")"
|
||||
"{" "}"
|
||||
] @punctuation.bracket
|
||||
|
||||
; operator
|
||||
; --------
|
||||
|
||||
[
|
||||
"-" "-="
|
||||
"+" "+="
|
||||
"*" "*="
|
||||
"/" "/="
|
||||
"%" "%="
|
||||
"=" "=="
|
||||
"!" "!=" "!!"
|
||||
"<" "<=" "<<"
|
||||
">" ">=" ">>"
|
||||
"&" "|" "^"
|
||||
"&&" "||"
|
||||
] @operator
|
||||
|
||||
; constructor
|
||||
; -----------
|
||||
|
||||
(instance_expression
|
||||
name: (identifier) @constructor)
|
||||
|
||||
(initOf
|
||||
name: (identifier) @constructor)
|
||||
|
||||
; type
|
||||
; ----
|
||||
|
||||
(type_identifier) @type
|
||||
|
||||
; type.builtin
|
||||
; ------------
|
||||
|
||||
(tlb_serialization
|
||||
"as" @keyword
|
||||
type: (identifier) @type.builtin
|
||||
(#match? @type.builtin
|
||||
"^(int8|int16|int32|int64|int128|int256|int257|uint8|uint16|uint32|uint64|uint128|uint256|coins|remaining|bytes32|bytes64)$"))
|
||||
|
||||
((type_identifier) @type.builtin
|
||||
(#match? @type.builtin "^(Address|Bool|Builder|Cell|Int|Slice|String|StringBuilder)$"))
|
||||
|
||||
(map_type
|
||||
"map" @type.builtin
|
||||
"<" @punctuation.bracket
|
||||
">" @punctuation.bracket)
|
||||
|
||||
(bounced_type
|
||||
"bounced" @type.builtin
|
||||
"<" @punctuation.bracket
|
||||
">" @punctuation.bracket)
|
||||
|
||||
((identifier) @type.builtin
|
||||
(#eq? @type.builtin "SendParameters")
|
||||
(#is-not? local))
|
||||
|
||||
; string
|
||||
; ------
|
||||
|
||||
(string) @string
|
||||
|
||||
; string.special
|
||||
; --------------
|
||||
|
||||
(import
|
||||
library: (string) @string.special)
|
||||
|
||||
(escape_sequence) @string.special
|
||||
|
||||
; constant
|
||||
; --------
|
||||
|
||||
(global_constant
|
||||
name: (identifier) @constant)
|
||||
|
||||
(storage_constant
|
||||
name: (identifier) @constant)
|
||||
|
||||
; constant.builtin
|
||||
; ----------------
|
||||
|
||||
[
|
||||
(boolean)
|
||||
(null)
|
||||
] @constant.builtin
|
||||
|
||||
((identifier) @constant.builtin
|
||||
(#match? @constant.builtin
|
||||
"^(SendBounceIfActionFail|SendPayGasSeparately|SendIgnoreErrors|SendDestroyIfZero|SendRemainingValue|SendRemainingBalance|ReserveExact|ReserveAllExcept|ReserveAtMost|ReserveAddOriginalBalance|ReserveInvertSign|ReserveBounceIfActionFail)$")
|
||||
(#is-not? local))
|
||||
|
||||
; property
|
||||
; --------
|
||||
|
||||
(instance_argument
|
||||
name: (identifier) @property)
|
||||
|
||||
(lvalue (_) (_) @property)
|
||||
|
||||
(field_access_expression
|
||||
name: (identifier) @property)
|
||||
|
||||
(field
|
||||
name: (identifier) @property)
|
||||
|
||||
(storage_variable
|
||||
name: (identifier) @property)
|
||||
|
||||
; number
|
||||
; ------
|
||||
|
||||
(integer) @number
|
||||
|
||||
; keyword
|
||||
; -------
|
||||
|
||||
(foreach_statement
|
||||
. (_)
|
||||
. (_)
|
||||
. "in" @keyword)
|
||||
|
||||
[
|
||||
"get" "mutates" "extends" "virtual" "override" "inline" "abstract"
|
||||
"contract" "trait" "struct" "message" "with"
|
||||
"const" "let" "fun" "native"
|
||||
"primitive" "import"
|
||||
"if" "else" "while" "repeat" "do" "until" "foreach"
|
||||
"try" "catch"
|
||||
"return" "initOf"
|
||||
; "public" ; -- not used, but declared in grammar.ohm
|
||||
; "extend" ; -- not used, but declared in grammar.ohm
|
||||
] @keyword
|
||||
|
||||
; function
|
||||
; --------
|
||||
|
||||
(storage_function
|
||||
name: (identifier) @function)
|
||||
|
||||
(native_function
|
||||
name: (identifier) @function)
|
||||
|
||||
(global_function
|
||||
name: (identifier) @function)
|
||||
|
||||
(static_call_expression
|
||||
name: (identifier) @function)
|
||||
|
||||
(init_function
|
||||
"init" @function)
|
||||
|
||||
(receive_function
|
||||
"receive" @function)
|
||||
|
||||
(bounced_function
|
||||
"bounced" @function)
|
||||
|
||||
(external_function
|
||||
"external" @function)
|
||||
|
||||
(func_identifier) @function
|
||||
|
||||
(method_call_expression
|
||||
name: (identifier) @function)
|
||||
|
||||
; function.builtin
|
||||
; ----------------
|
||||
|
||||
(static_call_expression
|
||||
name: (identifier) @function.builtin
|
||||
(#match? @function.builtin
|
||||
"^(log|log2|send|sender|require|now|myBalance|myAddress|newAddress|contractAddress|contractAddressExt|emit|cell|ton|dump|dumpStack|beginString|beginComment|beginTailString|beginStringFromBuilder|beginCell|emptyCell|randomInt|random|checkSignature|checkDataSignature|sha256|min|max|abs|pow|pow2|throw|nativeThrowIf|nativeThrowUnless|getConfigParam|nativeRandomize|nativeRandomizeLt|nativePrepareRandom|nativeRandom|nativeRandomInterval|nativeReserve)$")
|
||||
(#is-not? local))
|
||||
|
||||
; attribute
|
||||
; ---------
|
||||
|
||||
[
|
||||
"@name"
|
||||
"@interface"
|
||||
] @attribute
|
||||
|
||||
; comment
|
||||
; -------
|
||||
|
||||
(comment) @comment
|
||||
@ -0,0 +1,45 @@
|
||||
; See: https://tree-sitter.github.io/tree-sitter/syntax-highlighting#local-variables
|
||||
|
||||
; Scopes @local.scope
|
||||
; -------------------------
|
||||
|
||||
[
|
||||
(global_function)
|
||||
(init_function)
|
||||
(bounced_function)
|
||||
(receive_function)
|
||||
(external_function)
|
||||
(storage_function)
|
||||
(block_statement)
|
||||
] @local.scope
|
||||
|
||||
; Definitions @local.definition
|
||||
; ------------------------------
|
||||
|
||||
(global_constant
|
||||
name: (identifier) @local.definition)
|
||||
|
||||
(storage_constant
|
||||
name: (identifier) @local.definition)
|
||||
|
||||
(storage_variable
|
||||
name: (identifier) @local.definition)
|
||||
|
||||
(let_statement
|
||||
name: (identifier) @local.definition)
|
||||
|
||||
(parameter
|
||||
name: (identifier) @local.definition)
|
||||
|
||||
(foreach_statement
|
||||
key: (identifier) @local.definition
|
||||
value: (identifier) @local.definition)
|
||||
|
||||
; References @local.reference
|
||||
; -----------------------------
|
||||
|
||||
(self) @local.reference
|
||||
|
||||
(value_expression (identifier) @local.reference)
|
||||
|
||||
(lvalue (identifier) @local.reference)
|
||||
111
config/neovim/store/treesitter-parsers/queries/tact/tags.scm
Normal file
111
config/neovim/store/treesitter-parsers/queries/tact/tags.scm
Normal file
@ -0,0 +1,111 @@
|
||||
; See: https://tree-sitter.github.io/tree-sitter/code-navigation-systems
|
||||
|
||||
; Class definitions @definition.class
|
||||
; -------------------------------------------
|
||||
|
||||
(
|
||||
(comment)* @doc
|
||||
.
|
||||
[
|
||||
(contract
|
||||
name: (identifier) @name)
|
||||
(message
|
||||
name: (type_identifier) @name)
|
||||
(struct
|
||||
name: (type_identifier) @name)
|
||||
] @definition.class
|
||||
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
||||
(#select-adjacent! @doc @definition.class)
|
||||
)
|
||||
|
||||
|
||||
; Function definitions @definition.function
|
||||
; ----------------------------------------------
|
||||
|
||||
(
|
||||
(comment)* @doc
|
||||
.
|
||||
[
|
||||
(native_function
|
||||
name: (identifier) @name)
|
||||
(global_function
|
||||
name: (identifier) @name)
|
||||
] @definition.function
|
||||
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
||||
(#select-adjacent! @doc @definition.function)
|
||||
)
|
||||
|
||||
|
||||
; Interface definitions @definition.interface
|
||||
; -----------------------------------------------
|
||||
|
||||
(
|
||||
(comment)* @doc
|
||||
.
|
||||
(trait
|
||||
name: (identifier) @name) @definition.interface
|
||||
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
||||
(#select-adjacent! @doc @definition.interface)
|
||||
)
|
||||
|
||||
|
||||
; Method definitions @definition.method
|
||||
; --------------------------------------------
|
||||
|
||||
(
|
||||
(comment)* @doc
|
||||
.
|
||||
[
|
||||
(init_function "init" @name)
|
||||
(receive_function "receive" @name)
|
||||
(bounced_function "bounced" @name)
|
||||
(external_function "external" @name)
|
||||
(storage_function
|
||||
name: (identifier) @name)
|
||||
] @definition.method
|
||||
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
||||
(#select-adjacent! @doc @definition.method)
|
||||
)
|
||||
|
||||
|
||||
; Constant definitions @definition.constant
|
||||
; ----------------------------------------------
|
||||
|
||||
(
|
||||
(comment)* @doc
|
||||
.
|
||||
[
|
||||
(global_constant
|
||||
name: (identifier) @name)
|
||||
(storage_constant
|
||||
name: (identifier) @name)
|
||||
] @definition.constant
|
||||
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
||||
(#select-adjacent! @doc @definition.constant)
|
||||
)
|
||||
|
||||
|
||||
; Function/method calls @reference.call
|
||||
; -----------------------------------------
|
||||
|
||||
(
|
||||
[
|
||||
(method_call_expression
|
||||
name: (identifier) @name)
|
||||
(static_call_expression
|
||||
name: (identifier) @name)
|
||||
] @reference.call
|
||||
)
|
||||
|
||||
|
||||
; Class reference @reference.class
|
||||
; ------------------------------------------
|
||||
|
||||
(
|
||||
[
|
||||
(instance_expression
|
||||
name: (identifier) @name)
|
||||
(initOf
|
||||
name: (identifier) @name)
|
||||
] @reference.class
|
||||
)
|
||||
Reference in New Issue
Block a user