Skip to content

Commit 6ba8207

Browse files
talon
1 parent 04e76ef commit 6ba8207

File tree

10 files changed

+230
-33
lines changed

10 files changed

+230
-33
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
hello: "world"
2+
---
3+
4+
[#1 Range] =
5+
[#1 Domain] = 0:0-0:14
6+
>--------------<
7+
0| hello: "world"
8+
9+
10+
[#2 Range] =
11+
[#2 Domain] = 0:7-0:14
12+
>-------<
13+
0| hello: "world"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
settings():
2+
foo = 0
3+
---
4+
5+
[#1 Range] =
6+
[#1 Domain] = 0:0-1:11
7+
>-----------
8+
0| settings():
9+
1| foo = 0
10+
-----------<
11+
12+
13+
[#2 Range] =
14+
[#2 Domain] = 1:4-1:11
15+
>-------<
16+
1| foo = 0
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
mode: command
2+
-
3+
4+
hello: "world"
5+
6+
settings():
7+
foo = 0
8+
---
9+
10+
[#1 Range] =
11+
[#1 Domain] = 0:0-0:13
12+
>-------------<
13+
0| mode: command
14+
15+
16+
[#2 Range] =
17+
[#2 Domain] = 0:0-6:11
18+
>-------------
19+
0| mode: command
20+
1| -
21+
2|
22+
3| hello: "world"
23+
4|
24+
5| settings():
25+
6| foo = 0
26+
-----------<
27+
28+
29+
[#3 Range] =
30+
[#3 Domain] = 3:0-6:11
31+
>--------------
32+
3| hello: "world"
33+
4|
34+
5| settings():
35+
6| foo = 0
36+
-----------<
37+
38+
39+
[#4 Range] =
40+
[#4 Domain] = 3:7-3:14
41+
>-------<
42+
3| hello: "world"
43+
44+
45+
[#5 Range] =
46+
[#5 Domain] = 6:4-6:11
47+
>-------<
48+
6| foo = 0
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
mode: command
3+
-
4+
5+
---
6+
7+
[#1 Range] =
8+
[#1 Domain] = 0:0-3:0
9+
>
10+
0|
11+
1| mode: command
12+
2| -
13+
3|
14+
<
15+
16+
17+
[#2 Range] =
18+
[#2 Domain] = 1:0-1:13
19+
>-------------<
20+
1| mode: command
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
hello: "world"
2+
---
3+
4+
[#1 Range] =
5+
[#1 Domain] = 0:0-0:14
6+
>--------------<
7+
0| hello: "world"
8+
9+
10+
[#2 Range] =
11+
[#2 Domain] = 0:7-0:14
12+
>-------<
13+
0| hello: "world"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
settings():
2+
foo = 0
3+
---
4+
5+
[#1 Range] =
6+
[#1 Domain] = 0:0-1:11
7+
>-----------
8+
0| settings():
9+
1| foo = 0
10+
-----------<
11+
12+
13+
[#2 Range] =
14+
[#2 Domain] = 1:4-1:11
15+
>-------<
16+
1| foo = 0
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
mode: command
2+
-
3+
4+
hello: "world"
5+
6+
settings():
7+
foo = 0
8+
---
9+
10+
[#1 Range] =
11+
[#1 Domain] = 0:0-0:13
12+
>-------------<
13+
0| mode: command
14+
15+
16+
[#2 Range] =
17+
[#2 Domain] = 0:0-6:11
18+
>-------------
19+
0| mode: command
20+
1| -
21+
2|
22+
3| hello: "world"
23+
4|
24+
5| settings():
25+
6| foo = 0
26+
-----------<
27+
28+
29+
[#3 Range] =
30+
[#3 Domain] = 3:0-6:11
31+
>--------------
32+
3| hello: "world"
33+
4|
34+
5| settings():
35+
6| foo = 0
36+
-----------<
37+
38+
39+
[#4 Range] =
40+
[#4 Domain] = 3:7-3:14
41+
>-------<
42+
3| hello: "world"
43+
44+
45+
[#5 Range] =
46+
[#5 Domain] = 6:4-6:11
47+
>-------<
48+
6| foo = 0
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
mode: command
3+
-
4+
5+
---
6+
7+
[#1 Range] =
8+
[#1 Domain] = 0:0-3:0
9+
>
10+
0|
11+
1| mode: command
12+
2| -
13+
3|
14+
<
15+
16+
17+
[#2 Range] =
18+
[#2 Domain] = 1:0-1:13
19+
>-------------<
20+
1| mode: command

packages/common/src/scopeSupportFacets/talon.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,17 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = {
1919
"name.assignment": supported,
2020
"name.field": supported,
2121
"name.variable": supported,
22+
"name.iteration.block": supported,
23+
"name.iteration.document": supported,
2224

2325
"statement.iteration.block": supported,
2426
"statement.iteration.document": supported,
2527

2628
"value.assignment": supported,
2729
"value.field": supported,
2830
"value.variable": supported,
31+
"value.iteration.block": supported,
32+
"value.iteration.document": supported,
2933

3034
command: supported,
3135
statement: supported,
@@ -152,8 +156,7 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = {
152156
"name.constructor": notApplicable,
153157
"name.foreach": notApplicable,
154158
"name.function": notApplicable,
155-
"name.iteration.block": notApplicable,
156-
"name.iteration.document": notApplicable,
159+
"name.iteration.class": notApplicable,
157160
"name.method": notApplicable,
158161
"name.resource": notApplicable,
159162
"name.resource.iteration": notApplicable,
@@ -215,6 +218,7 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = {
215218
"value.typeAlias": notApplicable,
216219
"value.variable.pattern": notApplicable,
217220
"value.yield": notApplicable,
221+
"value.iteration.class": notApplicable,
218222
"string.multiLine": notApplicable,
219223
"textFragment.string.multiLine": notApplicable,
220224
selector: notApplicable,

queries/talon.scm

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
(_
4040
left: _ @name
4141
) @_.domain
42-
(#not-type? @_.domain "binary_operator")
42+
(#not-type? @_.domain binary_operator)
4343
)
4444

4545
;;!! not mode: command
@@ -53,7 +53,7 @@
5353
modifiers: (_)? @collectionKey.start
5454
left: _ @collectionKey.end
5555
) @_.domain
56-
(#not-type? @_.domain "binary_operator")
56+
(#not-type? @_.domain binary_operator)
5757
)
5858

5959
;;!! not mode: command
@@ -64,32 +64,36 @@
6464
(_
6565
right: (_) @value
6666
) @_.domain
67-
(#not-type? @_.domain "binary_operator")
67+
(#not-type? @_.domain binary_operator)
6868
)
6969

70-
;;!! mode: command
71-
;;! <*************
72-
;;!! tag: user.foo
73-
;;! *************>
74-
;;!! -
75-
;;!! settings():
76-
;;!! speech.debug = 1
77-
;;! <****************
78-
;;!! user.foo = "bar"
79-
;;! ****************>
80-
;;!!
81-
;;!! hello: "world"
82-
;;!1 <**************
83-
;;!! foo:
84-
;;!1 ****
85-
;;!! bar = 5
86-
;;!1 *******>
87-
;;!2 <*******>
88-
(_
89-
(_
90-
right: (_)
91-
)
92-
) @name.iteration @collectionKey.iteration @value.iteration
70+
;;!! mode: command
71+
;;! ^^^^^^^^^^^^^
72+
(matches
73+
(_) @name.iteration.end.endOf @collectionKey.iteration.end.endOf @value.iteration.end.endOf
74+
.
75+
) @name.iteration.start.startOf @collectionKey.iteration.start.startOf @value.iteration.start.startOf
76+
77+
;;!! hello: "world"
78+
;;! ^^^^^^^^^^^^^^
79+
(declarations) @name.iteration @collectionKey.iteration @value.iteration
80+
81+
;;!! hello: "world"
82+
;;! ^^^^^^^
83+
;;!! settings():
84+
;;!! speech.debug = 1
85+
;;! ^^^^^^^^^^^^^^^^
86+
(block) @name.iteration @collectionKey.iteration @value.iteration
87+
88+
(
89+
(source_file) @command.iteration @statement.iteration
90+
(#document-range! @command.iteration @statement.iteration)
91+
)
92+
93+
(
94+
(source_file) @name.iteration @collectionKey.iteration @value.iteration
95+
(#document-range! @name.iteration @collectionKey.iteration @value.iteration)
96+
)
9397

9498
;;!! tag: user.foo
9599
;;! {^^^^^^^^^^^^^
@@ -123,11 +127,6 @@
123127
(#insertion-delimiter! @command "\n")
124128
)
125129

126-
(
127-
(source_file) @command.iteration @statement.iteration
128-
(#document-range! @command.iteration @statement.iteration)
129-
)
130-
131130
;;!! key(enter)
132131
;;! ^^^^^^^^^^
133132
;;!! edit.left()

0 commit comments

Comments
 (0)