-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlocals.scm
86 lines (68 loc) · 2.1 KB
/
locals.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
; NOTE: The following queries are NOT used for highlighting, unlike in Tree-sitter or Helix. These are more like tags.scm.
; See: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#locals
; ------------------------------------------------------------------------------------------
; Scopes @local.scope
; -------------------------
[
(asm_function)
(global_function)
(init_function)
(bounced_function)
(receive_function)
(external_function)
(storage_function)
(block_statement)
] @local.scope
; Definitions @local.definition
; ------------------------------
; variables
(storage_variable
name: (identifier) @local.definition.var)
(let_statement
name: (identifier) @local.definition.var)
; constants
(global_constant
name: (identifier) @local.definition.constant)
(storage_constant
name: (identifier) @local.definition.constant)
; functions
(asm_function
name: (identifier) @local.definition.function
(#set! definition.var.scope parent))
(global_function
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))
(storage_function
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
; fields (of messages and structs)
(field
name: (identifier) @local.definition.field)
; imports
(import
(string) @local.definition.import)
; References @local.reference
; -----------------------------
(self) @local.reference
(value_expression
(identifier) @local.reference)
(field_access_expression
name: (identifier) @local.reference)