File tree Expand file tree Collapse file tree 5 files changed +287
-3
lines changed
data/fixtures/scopes/java
packages/common/src/scopeSupportFacets Expand file tree Collapse file tree 5 files changed +287
-3
lines changed Original file line number Diff line number Diff line change 1+ switch (value) {
2+ case 1, 2:
3+ break;
4+ case 3, 4:
5+ break;
6+ default:
7+ break;
8+ }
9+ ---
10+
11+ [#1.1 Content] = 1:9-1:10
12+ >-<
13+ 1| case 1, 2:
14+
15+ [#1.1 Removal] = 1:8-1:10
16+ >--<
17+ 1| case 1, 2:
18+
19+ [#1.1 Leading delimiter] = 1:8-1:9
20+ >-<
21+ 1| case 1, 2:
22+
23+ [#1.1 Insertion delimiter] = " "
24+
25+ [#1.2 Content] = 1:12-1:13
26+ >-<
27+ 1| case 1, 2:
28+
29+ [#1.2 Removal] = 1:11-1:13
30+ >--<
31+ 1| case 1, 2:
32+
33+ [#1.2 Leading delimiter] = 1:11-1:12
34+ >-<
35+ 1| case 1, 2:
36+
37+ [#1.2 Insertion delimiter] = " "
38+
39+ [#1 Domain] = 1:4-2:14
40+ >----------
41+ 1| case 1, 2:
42+ 2| break;
43+ --------------<
44+
45+
46+ [#2.1 Content] = 3:9-3:10
47+ >-<
48+ 3| case 3, 4:
49+
50+ [#2.1 Removal] = 3:8-3:10
51+ >--<
52+ 3| case 3, 4:
53+
54+ [#2.1 Leading delimiter] = 3:8-3:9
55+ >-<
56+ 3| case 3, 4:
57+
58+ [#2.1 Insertion delimiter] = " "
59+
60+ [#2.2 Content] = 3:12-3:13
61+ >-<
62+ 3| case 3, 4:
63+
64+ [#2.2 Removal] = 3:11-3:13
65+ >--<
66+ 3| case 3, 4:
67+
68+ [#2.2 Leading delimiter] = 3:11-3:12
69+ >-<
70+ 3| case 3, 4:
71+
72+ [#2.2 Insertion delimiter] = " "
73+
74+ [#2 Domain] = 3:4-4:14
75+ >----------
76+ 3| case 3, 4:
77+ 4| break;
78+ --------------<
Original file line number Diff line number Diff line change 1+ switch (value) {
2+ case 0 -> foo;
3+ case 1 -> bar;
4+ default -> {
5+ yield baz;
6+ }
7+ }
8+ ---
9+
10+ [#1 Content] = 1:4-5:5
11+ >--------------
12+ 1| case 0 -> foo;
13+ 2| case 1 -> bar;
14+ 3| default -> {
15+ 4| yield baz;
16+ 5| }
17+ -----<
18+
19+ [#1 Removal] = 0:16-6:0
20+ >
21+ 0| switch (value) {
22+ 1| case 0 -> foo;
23+ 2| case 1 -> bar;
24+ 3| default -> {
25+ 4| yield baz;
26+ 5| }
27+ 6| }
28+ <
29+
30+ [#1 Domain] = 0:0-6:1
31+ >----------------
32+ 0| switch (value) {
33+ 1| case 0 -> foo;
34+ 2| case 1 -> bar;
35+ 3| default -> {
36+ 4| yield baz;
37+ 5| }
38+ 6| }
39+ -<
40+
41+ [#1 Insertion delimiter] = " "
42+
43+
44+ [#2 Content] =
45+ [#2 Removal] = 0:8-0:13
46+ >-----<
47+ 0| switch (value) {
48+
49+ [#2 Domain] = 0:7-0:14
50+ >-------<
51+ 0| switch (value) {
52+
53+ [#2 Insertion delimiter] = " "
54+
55+
56+ [#3 Content] = 1:4-5:5
57+ >--------------
58+ 1| case 0 -> foo;
59+ 2| case 1 -> bar;
60+ 3| default -> {
61+ 4| yield baz;
62+ 5| }
63+ -----<
64+
65+ [#3 Removal] = 0:16-6:0
66+ >
67+ 0| switch (value) {
68+ 1| case 0 -> foo;
69+ 2| case 1 -> bar;
70+ 3| default -> {
71+ 4| yield baz;
72+ 5| }
73+ 6| }
74+ <
75+
76+ [#3 Domain] = 0:15-6:1
77+ >-
78+ 0| switch (value) {
79+ 1| case 0 -> foo;
80+ 2| case 1 -> bar;
81+ 3| default -> {
82+ 4| yield baz;
83+ 5| }
84+ 6| }
85+ -<
86+
87+ [#3 Insertion delimiter] = " "
88+
89+
90+ [#4 Content] =
91+ [#4 Removal] = 1:14-1:18
92+ >----<
93+ 1| case 0 -> foo;
94+
95+ [#4 Domain] = 1:4-1:18
96+ >--------------<
97+ 1| case 0 -> foo;
98+
99+ [#4 Insertion delimiter] = " "
100+
101+
102+ [#5 Content] =
103+ [#5 Removal] = 2:14-2:18
104+ >----<
105+ 2| case 1 -> bar;
106+
107+ [#5 Domain] = 2:4-2:18
108+ >--------------<
109+ 2| case 1 -> bar;
110+
111+ [#5 Insertion delimiter] = " "
112+
113+
114+ [#6 Content] = 4:8-4:18
115+ >----------<
116+ 4| yield baz;
117+
118+ [#6 Removal] = 3:16-5:4
119+ >
120+ 3| default -> {
121+ 4| yield baz;
122+ 5| }
123+ ----<
124+
125+ [#6 Domain] = 3:4-5:5
126+ >------------
127+ 3| default -> {
128+ 4| yield baz;
129+ 5| }
130+ -----<
131+
132+ [#6 Insertion delimiter] = " "
133+
134+
135+ [#7 Content] = 4:8-4:18
136+ >----------<
137+ 4| yield baz;
138+
139+ [#7 Removal] = 3:16-5:4
140+ >
141+ 3| default -> {
142+ 4| yield baz;
143+ 5| }
144+ ----<
145+
146+ [#7 Domain] = 3:15-5:5
147+ >-
148+ 3| default -> {
149+ 4| yield baz;
150+ 5| }
151+ -----<
152+
153+ [#7 Insertion delimiter] = " "
Original file line number Diff line number Diff line change 1+ switch (value) {
2+ case 1:
3+ yield "foo";
4+ default:
5+ yield "bar";
6+ }
7+ ---
8+
9+ [#1 Content] = 2:14-2:19
10+ >-----<
11+ 2| yield "foo";
12+
13+ [#1 Removal] = 2:13-2:19
14+ >------<
15+ 2| yield "foo";
16+
17+ [#1 Leading delimiter] = 2:13-2:14
18+ >-<
19+ 2| yield "foo";
20+
21+ [#1 Domain] = 2:8-2:20
22+ >------------<
23+ 2| yield "foo";
24+
25+ [#1 Insertion delimiter] = " "
26+
27+
28+ [#2 Content] = 4:14-4:19
29+ >-----<
30+ 4| yield "bar";
31+
32+ [#2 Removal] = 4:13-4:19
33+ >------<
34+ 4| yield "bar";
35+
36+ [#2 Leading delimiter] = 4:13-4:14
37+ >-<
38+ 4| yield "bar";
39+
40+ [#2 Domain] = 4:8-4:20
41+ >------------<
42+ 4| yield "bar";
43+
44+ [#2 Insertion delimiter] = " "
Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = {
141141 "value.foreach" : supported ,
142142 "value.field.class" : supported ,
143143 "value.return" : supported ,
144+ "value.yield" : supported ,
144145 "value.return.lambda" : supported ,
145146 "value.variable" : supported ,
146147 "value.resource" : supported ,
@@ -289,7 +290,6 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = {
289290 "value.iteration.enum" : notApplicable ,
290291
291292 // Miscellaneous
292- "value.yield" : notApplicable ,
293293 pairDelimiter : notApplicable ,
294294 regularExpression : notApplicable ,
295295 environment : notApplicable ,
Original file line number Diff line number Diff line change 199199 (switch_label
200200 (_) @condition
201201 )
202+ (#allow-multiple! @condition )
202203) @condition.domain
203204
204205;; !! case "0" -> "zero";
524525;; ! ^^^^^
525526;; ! -------------
526527(
527- (return_statement) @value @_.domain
528- (#child-range! @value 1 -2)
528+ (return_statement
529+ (_) @value
530+ ) @_.domain
529531)
530532
533+ ;; !! yield value;
534+ ;; ! ^^^^^
535+ ;; ! ------------
536+ (yield_statement
537+ (_) @value
538+ ) @_.domain
539+
531540;; !! str -> str.length > 0
532541;; ! ^^^^^^^^^^^^^^
533542;; ! ---------------------
You can’t perform that action at this time.
0 commit comments