Skip to content

Commit f7e1dd2

Browse files
Added argument list scope (#2907)
Fixes #493
1 parent 72e5e39 commit f7e1dd2

File tree

77 files changed

+1313
-159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1313
-159
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
tags: [enhancement]
3+
pullRequest: 2907
4+
---
5+
6+
- Added `"arg list"` scope. The argument list is the entire list of arguments in a declared function.

cursorless-talon/src/spoken_forms.json

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
"modifier_scope_types.csv": {
126126
"scope_type": {
127127
"arg": "argumentOrParameter",
128+
"arg list": "argumentList",
128129
"attribute": "attribute",
129130
"call": "functionCall",
130131
"callee": "functionCallee",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
public class MyClass {
2+
public MyClass(
3+
String name,
4+
int age
5+
) {}
6+
}
7+
---
8+
9+
[#1 Content] =
10+
[#1 Domain] = 2:8-2:19
11+
>-----------<
12+
2| String name,
13+
14+
[#1 Removal] = 2:8-3:8
15+
>------------
16+
2| String name,
17+
3| int age
18+
--------<
19+
20+
[#1 Trailing delimiter] = 2:19-3:8
21+
>-
22+
2| String name,
23+
3| int age
24+
--------<
25+
26+
[#1 Insertion delimiter] = ",\n"
27+
28+
29+
[#2 Content] =
30+
[#2 Domain] = 3:8-3:15
31+
>-------<
32+
3| int age
33+
34+
[#2 Removal] = 2:19-3:15
35+
>-
36+
2| String name,
37+
3| int age
38+
---------------<
39+
40+
[#2 Leading delimiter] = 2:19-3:8
41+
>-
42+
2| String name,
43+
3| int age
44+
--------<
45+
46+
[#2 Insertion delimiter] = ",\n"

data/fixtures/scopes/java/argument.formal.iteration.scope

-12
This file was deleted.

data/fixtures/scopes/java/argument.formal.iteration2.scope

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

data/fixtures/scopes/java/argument.formal.scope

-35
This file was deleted.

data/fixtures/scopes/java/argument.formal2.scope

-46
This file was deleted.

data/fixtures/scopes/java/argument.formal3.scope

-35
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
public class MyClass {
2+
public MyClass(String name, int age) {}
3+
}
4+
---
5+
6+
[Content] =
7+
[Removal] = 1:19-1:39
8+
>--------------------<
9+
1| public MyClass(String name, int age) {}
10+
11+
[Domain] = 1:4-1:43
12+
>---------------------------------------<
13+
1| public MyClass(String name, int age) {}
14+
15+
[Insertion delimiter] = ", "
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
public class MyClass {
2+
public MyClass(
3+
String name,
4+
int age
5+
) {}
6+
}
7+
---
8+
9+
[Content] =
10+
[Removal] = 1:19-4:4
11+
>
12+
1| public MyClass(
13+
2| String name,
14+
3| int age
15+
4| ) {}
16+
----<
17+
18+
[Domain] = 1:4-4:8
19+
>---------------
20+
1| public MyClass(
21+
2| String name,
22+
3| int age
23+
4| ) {}
24+
--------<
25+
26+
[Insertion delimiter] = ",\n"

0 commit comments

Comments
 (0)