Skip to content

Commit 2c73ca7

Browse files
Migrate java args scope (#2365)
## Checklist - [x] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [/] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [/] I have not broken the cheatsheet
1 parent 971ee29 commit 2c73ca7

File tree

13 files changed

+272
-15
lines changed

13 files changed

+272
-15
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
myFunk(5, "hello");
2+
---
3+
4+
[Range] = 0:7-0:17
5+
>----------<
6+
0| myFunk(5, "hello");
7+
8+
[Domain] = 0:6-0:18
9+
>------------<
10+
0| myFunk(5, "hello");
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
myFunk(5, "hello");
2+
---
3+
4+
[#1 Content] =
5+
[#1 Domain] = 0:7-0:8
6+
>-<
7+
0| myFunk(5, "hello");
8+
9+
[#1 Removal] = 0:7-0:10
10+
>---<
11+
0| myFunk(5, "hello");
12+
13+
[#1 Trailing delimiter] = 0:8-0:10
14+
>--<
15+
0| myFunk(5, "hello");
16+
17+
[#1 Insertion delimiter] = ", "
18+
19+
20+
[#2 Content] =
21+
[#2 Domain] = 0:10-0:17
22+
>-------<
23+
0| myFunk(5, "hello");
24+
25+
[#2 Removal] = 0:8-0:17
26+
>---------<
27+
0| myFunk(5, "hello");
28+
29+
[#2 Leading delimiter] = 0:8-0:10
30+
>--<
31+
0| myFunk(5, "hello");
32+
33+
[#2 Insertion delimiter] = ", "
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
myFunk(
2+
5,
3+
"hello"
4+
);
5+
---
6+
7+
[#1 Content] =
8+
[#1 Domain] = 1:4-1:5
9+
>-<
10+
1| 5,
11+
12+
[#1 Removal] = 1:4-2:4
13+
>--
14+
1| 5,
15+
2| "hello"
16+
----<
17+
18+
[#1 Trailing delimiter] = 1:5-2:4
19+
>-
20+
1| 5,
21+
2| "hello"
22+
----<
23+
24+
[#1 Insertion delimiter] = ",\n"
25+
26+
27+
[#2 Content] =
28+
[#2 Domain] = 2:4-2:11
29+
>-------<
30+
2| "hello"
31+
32+
[#2 Removal] = 1:5-2:11
33+
>-
34+
1| 5,
35+
2| "hello"
36+
-----------<
37+
38+
[#2 Leading delimiter] = 1:5-2:4
39+
>-
40+
1| 5,
41+
2| "hello"
42+
----<
43+
44+
[#2 Insertion delimiter] = ",\n"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
public class MyClass {
2+
public void myFunk(int value, String name) { }
3+
}
4+
---
5+
6+
[Range] = 1:23-1:45
7+
>----------------------<
8+
1| public void myFunk(int value, String name) { }
9+
10+
[Domain] = 1:4-1:50
11+
>----------------------------------------------<
12+
1| public void myFunk(int value, String name) { }
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class MyClass {
2+
MyClass(int value, String name) { }
3+
}
4+
---
5+
6+
[Range] = 1:12-1:34
7+
>----------------------<
8+
1| MyClass(int value, String name) { }
9+
10+
[Domain] = 1:4-1:39
11+
>-----------------------------------<
12+
1| MyClass(int value, String name) { }
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
public class MyClass {
2+
public void myFunk(int value, String name) { }
3+
}
4+
---
5+
6+
[#1 Content] =
7+
[#1 Domain] = 1:23-1:32
8+
>---------<
9+
1| public void myFunk(int value, String name) { }
10+
11+
[#1 Removal] = 1:23-1:34
12+
>-----------<
13+
1| public void myFunk(int value, String name) { }
14+
15+
[#1 Trailing delimiter] = 1:32-1:34
16+
>--<
17+
1| public void myFunk(int value, String name) { }
18+
19+
[#1 Insertion delimiter] = ", "
20+
21+
22+
[#2 Content] =
23+
[#2 Domain] = 1:34-1:45
24+
>-----------<
25+
1| public void myFunk(int value, String name) { }
26+
27+
[#2 Removal] = 1:32-1:45
28+
>-------------<
29+
1| public void myFunk(int value, String name) { }
30+
31+
[#2 Leading delimiter] = 1:32-1:34
32+
>--<
33+
1| public void myFunk(int value, String name) { }
34+
35+
[#2 Insertion delimiter] = ", "
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
public class MyClass {
2+
public void myFunk(
3+
int value,
4+
String name
5+
) { }
6+
}
7+
---
8+
9+
[#1 Content] =
10+
[#1 Domain] = 2:8-2:17
11+
>---------<
12+
2| int value,
13+
14+
[#1 Removal] = 2:8-3:8
15+
>----------
16+
2| int value,
17+
3| String name
18+
--------<
19+
20+
[#1 Trailing delimiter] = 2:17-3:8
21+
>-
22+
2| int value,
23+
3| String name
24+
--------<
25+
26+
[#1 Insertion delimiter] = ",\n"
27+
28+
29+
[#2 Content] =
30+
[#2 Domain] = 3:8-3:19
31+
>-----------<
32+
3| String name
33+
34+
[#2 Removal] = 2:17-3:19
35+
>-
36+
2| int value,
37+
3| String name
38+
-------------------<
39+
40+
[#2 Leading delimiter] = 2:17-3:8
41+
>-
42+
2| int value,
43+
3| String name
44+
--------<
45+
46+
[#2 Insertion delimiter] = ",\n"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
class MyClass {
2+
MyClass(int value, String name) { }
3+
}
4+
---
5+
6+
[#1 Content] =
7+
[#1 Domain] = 1:12-1:21
8+
>---------<
9+
1| MyClass(int value, String name) { }
10+
11+
[#1 Removal] = 1:12-1:23
12+
>-----------<
13+
1| MyClass(int value, String name) { }
14+
15+
[#1 Trailing delimiter] = 1:21-1:23
16+
>--<
17+
1| MyClass(int value, String name) { }
18+
19+
[#1 Insertion delimiter] = ", "
20+
21+
22+
[#2 Content] =
23+
[#2 Domain] = 1:23-1:34
24+
>-----------<
25+
1| MyClass(int value, String name) { }
26+
27+
[#2 Removal] = 1:21-1:34
28+
>-------------<
29+
1| MyClass(int value, String name) { }
30+
31+
[#2 Leading delimiter] = 1:21-1:23
32+
>--<
33+
1| MyClass(int value, String name) { }
34+
35+
[#2 Insertion delimiter] = ", "

packages/common/src/scopeSupportFacets/java.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = {
1111
"name.foreach": supported,
1212
"value.foreach": supported,
1313
"type.foreach": supported,
14+
"argument.formal": supported,
15+
"argument.formal.iteration": supported,
16+
"argument.actual": supported,
17+
"argument.actual.iteration": supported,
1418

1519
element: notApplicable,
1620
tags: notApplicable,

packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export const scopeSupportFacetInfos: Record<
168168
},
169169
"argument.formal.iteration": {
170170
description:
171-
"Iteration scope of the formal parameters of a function declaration; should be the whole parameter list",
171+
"Iteration scope of the formal parameters of a function declaration; should be the whole parameter list. The domain should be the entire function.",
172172
scopeType: "argumentOrParameter",
173173
isIteration: true,
174174
},

0 commit comments

Comments
 (0)