Skip to content

Commit 776275d

Browse files
Added branch.loop
1 parent 5b90419 commit 776275d

File tree

6 files changed

+45
-5
lines changed

6 files changed

+45
-5
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
for (int i = 0; i < size; ++i) { }
2+
---
3+
4+
[Content] =
5+
[Removal] =
6+
[Domain] = 0:0-0:34
7+
>----------------------------------<
8+
0| for (int i = 0; i < size; ++i) { }
9+
10+
[Insertion delimiter] = "\n"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
for (final int v : values) { }
2+
---
3+
4+
[Content] =
5+
[Removal] =
6+
[Domain] = 0:0-0:30
7+
>------------------------------<
8+
0| for (final int v : values) { }
9+
10+
[Insertion delimiter] = "\n"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
while(true) { }
2+
---
3+
4+
[Content] =
5+
[Removal] =
6+
[Domain] = 0:0-0:15
7+
>---------------<
8+
0| while(true) { }
9+
10+
[Insertion delimiter] = "\n"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
do { } while(true);
2+
---
3+
4+
[Content] =
5+
[Removal] =
6+
[Domain] = 0:0-0:19
7+
>-------------------<
8+
0| do { } while(true);
9+
10+
[Insertion delimiter] = "\n"

packages/common/src/scopeSupportFacets/java.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = {
3333
"branch.switchCase": supported,
3434
"branch.switchCase.iteration": supported,
3535
"branch.ternary": supported,
36+
"branch.loop": supported,
3637

3738
class: supported,
3839
"class.iteration.block": supported,
@@ -143,7 +144,6 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = {
143144

144145
"string.multiLine": unsupported,
145146
"textFragment.string.multiLine": unsupported,
146-
"branch.loop": unsupported,
147147
fieldAccess: unsupported,
148148

149149
// Not Applicable

queries/java.scm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,20 +203,20 @@
203203
;;! ------------------------------
204204
(for_statement
205205
condition: (_) @condition
206-
) @_.domain
206+
) @branch @_.domain
207207

208208
;;!! while (value) {}
209209
;;! ^^^^^
210210
;;! ----------------
211211
(while_statement
212212
condition: (_) @condition
213213
(#child-range! @condition 0 -1 true true)
214-
) @_.domain
214+
) @branch @_.domain
215215

216216
(do_statement
217217
condition: (_) @condition
218218
(#child-range! @condition 0 -1 true true)
219-
) @_.domain
219+
) @branch @_.domain
220220

221221
;;!! switch (value) {}
222222
;;! ^^^^^
@@ -330,7 +330,7 @@
330330
type: (_) @type
331331
name: (_) @name
332332
value: (_) @value
333-
) @_.domain
333+
) @branch @_.domain
334334

335335
;;!! int value = 1;
336336
;;! ^

0 commit comments

Comments
 (0)