nvim-treesitter/runtime/queries/tact/locals.scm

84 lines
1.8 KiB
Scheme
Raw Permalink Normal View History

2024-05-03 18:42:51 +02:00
; Scopes @local.scope
; -------------------------
[
(asm_function)
2024-06-25 09:31:11 +02:00
(global_function)
2024-05-03 18:42:51 +02:00
(init_function)
(bounced_function)
(receive_function)
(external_function)
2024-06-25 09:31:11 +02:00
(storage_function)
2024-05-03 18:42:51 +02:00
(block_statement)
] @local.scope
; Definitions @local.definition
; ------------------------------
; variables
(storage_variable
name: (identifier) @local.definition.var)
2024-05-03 18:42:51 +02:00
(let_statement
name: (identifier) @local.definition.var)
; constants
2024-06-25 09:31:11 +02:00
(global_constant
name: (identifier) @local.definition.constant)
(storage_constant
2024-05-03 18:42:51 +02:00
name: (identifier) @local.definition.constant)
; functions
(asm_function
name: (identifier) @local.definition.function
(#set! definition.var.scope parent))
2024-06-25 09:31:11 +02:00
(global_function
2024-05-03 18:42:51 +02:00
name: (identifier) @local.definition.function
(#set! definition.var.scope parent))
; methods (functions off of contracts and traits)
(init_function
"init" @local.definition.method
(#set! definition.var.scope parent))
(bounced_function
"bounced" @local.definition.method
(#set! definition.var.scope parent))
(receive_function
"receive" @local.definition.method
(#set! definition.var.scope parent))
(external_function
"external" @local.definition.method
(#set! definition.var.scope parent))
2024-06-25 09:31:11 +02:00
(storage_function
2024-05-03 18:42:51 +02:00
name: (identifier) @local.definition.method
(#set! definition.var.scope parent))
; parameters
(parameter
name: (identifier) @local.definition.parameter)
; user-defined types (structs and messages)
(type_identifier) @local.definition.type
2024-06-25 09:31:11 +02:00
; fields (of messages and structs)
2024-05-03 18:42:51 +02:00
(field
name: (identifier) @local.definition.field)
; imports
2024-06-25 09:31:11 +02:00
(import
name: (string) @local.definition.import)
2024-05-03 18:42:51 +02:00
; References @local.reference
; -----------------------------
(self) @local.reference
(value_expression
(identifier) @local.reference)
2024-08-24 15:08:40 +02:00
(field_access_expression
name: (identifier) @local.reference)