Skip to content

Commit 5b90419

Browse files
Implementing missing java scopes
1 parent 1c7bd74 commit 5b90419

File tree

6 files changed

+102
-5
lines changed

6 files changed

+102
-5
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
public class MyClass {
2+
3+
}
4+
---
5+
6+
[#1 Range] =
7+
[#1 Domain] = 0:0-2:1
8+
>----------------------
9+
0| public class MyClass {
10+
1|
11+
2| }
12+
-<
13+
14+
15+
[#2 Range] = 0:22-2:0
16+
>
17+
0| public class MyClass {
18+
1|
19+
2| }
20+
<
21+
22+
[#2 Domain] = 0:21-2:1
23+
>-
24+
0| public class MyClass {
25+
1|
26+
2| }
27+
-<
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
public class MyClass { }
3+
---
4+
5+
[#1 Range] =
6+
[#1 Domain] = 1:0-1:24
7+
>------------------------<
8+
1| public class MyClass { }
9+
10+
11+
[#2 Range] = 1:22-1:23
12+
>-<
13+
1| public class MyClass { }
14+
15+
[#2 Domain] = 1:21-1:24
16+
>---<
17+
1| public class MyClass { }
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
public class MyClass {
2+
3+
}
4+
---
5+
6+
[#1 Range] =
7+
[#1 Domain] = 0:0-2:1
8+
>----------------------
9+
0| public class MyClass {
10+
1|
11+
2| }
12+
-<
13+
14+
15+
[#2 Range] = 0:22-2:0
16+
>
17+
0| public class MyClass {
18+
1|
19+
2| }
20+
<
21+
22+
[#2 Domain] = 0:21-2:1
23+
>-
24+
0| public class MyClass {
25+
1|
26+
2| }
27+
-<
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
public class MyClass { }
3+
---
4+
5+
[#1 Range] =
6+
[#1 Domain] = 1:0-1:24
7+
>------------------------<
8+
1| public class MyClass { }
9+
10+
11+
[#2 Range] = 1:22-1:23
12+
>-<
13+
1| public class MyClass { }
14+
15+
[#2 Domain] = 1:21-1:24
16+
>---<
17+
1| public class MyClass { }

packages/common/src/scopeSupportFacets/java.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = {
3535
"branch.ternary": supported,
3636

3737
class: supported,
38+
"class.iteration.block": supported,
39+
"class.iteration.document": supported,
40+
3841
className: supported,
42+
"className.iteration.block": supported,
43+
"className.iteration.document": supported,
3944

4045
"comment.block": supported,
4146
"comment.line": supported,
@@ -100,11 +105,6 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = {
100105

101106
// Unsupported
102107

103-
"class.iteration.block": unsupported,
104-
"class.iteration.document": unsupported,
105-
"className.iteration.block": unsupported,
106-
"className.iteration.document": unsupported,
107-
108108
"name.iteration.document": unsupported,
109109
"name.iteration.block": unsupported,
110110
"name.resource": unsupported,

queries/java.scm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@
4242
name: (_) @name @className
4343
) @class @_.domain
4444

45+
(program) @class.iteration @className.iteration
46+
47+
(class_body
48+
.
49+
"{" @class.iteration.start.endOf @className.iteration.start.endOf
50+
"}" @class.iteration.end.startOf @className.iteration.end.startOf
51+
.
52+
) @class.iteration.domain @className.iteration.domain
53+
4554
;;!! void myFunk() {}
4655
;;! ^^^^^^^^^^^^^^^^
4756
(method_declaration

0 commit comments

Comments
 (0)