Skip to content

Commit 0eae2db

Browse files
committed
Add local variable queries
1 parent 3f51e8e commit 0eae2db

File tree

2 files changed

+81
-1
lines changed

2 files changed

+81
-1
lines changed

queries/highlights.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@
252252
"."
253253
"..."
254254
"::"
255-
] @punctuation.special
255+
] @punctuation
256256

257257
[
258258
","

queries/locals.scm

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
; References
2+
(identifier) @local.reference
3+
4+
; Definitions
5+
(assignment
6+
.
7+
(identifier) @local.definition)
8+
9+
(assignment
10+
.
11+
(tuple_expression
12+
(identifier) @local.definition))
13+
14+
(assignment
15+
.
16+
(open_tuple
17+
(identifier) @local.definition))
18+
19+
(let_binding
20+
.
21+
(identifier) @local.definition)
22+
23+
(let_binding
24+
.
25+
(tuple_expression
26+
(identifier) @local.definition))
27+
28+
(for_binding
29+
.
30+
(identifier) @local.definition)
31+
32+
(for_binding
33+
.
34+
(tuple_expression
35+
(identifier) @local.definition))
36+
37+
(import_statement
38+
(identifier) @local.definition)
39+
40+
(using_statement
41+
(identifier) @local.definition)
42+
43+
(selected_import
44+
(identifier) @local.definition)
45+
46+
(module_definition
47+
.
48+
(identifier) @local.definition)
49+
50+
(type_head
51+
(identifier) @local.definition)
52+
53+
(type_head
54+
(binary_expression
55+
.
56+
(identifier) @local.definition))
57+
58+
(function_definition
59+
(signature
60+
(call_expression
61+
.
62+
(identifier) @local.definition.function))) @local.scope
63+
64+
(macro_definition
65+
(signature
66+
(call_expression
67+
.
68+
(identifier) @local.definition.function))) @local.scope
69+
70+
; Scopes
71+
[
72+
(quote_statement)
73+
(let_statement)
74+
(for_statement)
75+
(while_statement)
76+
(try_statement)
77+
(catch_clause)
78+
(finally_clause)
79+
(do_clause)
80+
] @local.scope

0 commit comments

Comments
 (0)