Skip to content

Commit 20a1f3b

Browse files
committed
Add multiline and formal argument scope tests
1 parent bb1e8fb commit 20a1f3b

File tree

9 files changed

+232
-8
lines changed

9 files changed

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

4-
[Content] =
5-
[Removal] = 0:16-0:20
4+
[#1 Content] =
5+
[#1 Removal] = 0:16-0:20
66
>----<
77
0| abc <- function(x, y){ }
88

9-
[Domain] = 0:7-0:24
9+
[#1 Domain] = 0:0-0:24
10+
>------------------------<
11+
0| abc <- function(x, y){ }
12+
13+
[#1 Insertion delimiter] = ", "
14+
15+
16+
[#2 Content] =
17+
[#2 Removal] = 0:16-0:20
18+
>----<
19+
0| abc <- function(x, y){ }
20+
21+
[#2 Domain] = 0:7-0:24
1022
>-----------------<
1123
0| abc <- function(x, y){ }
1224

13-
[Insertion delimiter] = ", "
25+
[#2 Insertion delimiter] = ", "
Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
abc <- function(){ }
22
---
33

4-
[Content] =
5-
[Removal] = 0:16-0:16
4+
[#1 Content] =
5+
[#1 Removal] = 0:16-0:16
66
><
77
0| abc <- function(){ }
88

9-
[Domain] = 0:7-0:20
9+
[#1 Domain] = 0:0-0:20
10+
>--------------------<
11+
0| abc <- function(){ }
12+
13+
[#1 Insertion delimiter] = ""
14+
15+
16+
[#2 Content] =
17+
[#2 Removal] = 0:16-0:16
18+
><
19+
0| abc <- function(){ }
20+
21+
[#2 Domain] = 0:7-0:20
1022
>-------------<
1123
0| abc <- function(){ }
1224

13-
[Insertion delimiter] = ""
25+
[#2 Insertion delimiter] = ""
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
abc <- function(
2+
x,
3+
y
4+
){
5+
}
6+
---
7+
8+
[#1 Content] =
9+
[#1 Removal] = 0:16-3:0
10+
>
11+
0| abc <- function(
12+
1| x,
13+
2| y
14+
3| ){
15+
<
16+
17+
[#1 Domain] = 0:0-4:1
18+
>----------------
19+
0| abc <- function(
20+
1| x,
21+
2| y
22+
3| ){
23+
4| }
24+
-<
25+
26+
[#1 Insertion delimiter] = ",\n"
27+
28+
29+
[#2 Content] =
30+
[#2 Removal] = 0:16-3:0
31+
>
32+
0| abc <- function(
33+
1| x,
34+
2| y
35+
3| ){
36+
<
37+
38+
[#2 Domain] = 0:7-4:1
39+
>---------
40+
0| abc <- function(
41+
1| x,
42+
2| y
43+
3| ){
44+
4| }
45+
-<
46+
47+
[#2 Insertion delimiter] = ",\n"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
function(x, y){ }
2+
---
3+
4+
[Content] =
5+
[Removal] = 0:9-0:13
6+
>----<
7+
0| function(x, y){ }
8+
9+
[Domain] = 0:0-0:17
10+
>-----------------<
11+
0| function(x, y){ }
12+
13+
[Insertion delimiter] = ", "

packages/common/src/scopeSupportFacets/r.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
66
export const rScopeSupport: LanguageScopeSupportFacetMap = {
77
"anonymousFunction": supported,
88
"argument.actual": supported,
9+
"argument.formal": supported,
910
"argumentList.formal": supported,
11+
"argument.actual.iteration": supported,
12+
"argument.formal.iteration": supported,
1013
"comment.line": supported,
1114
"functionCall": supported,
1215
"functionCallee": supported,

0 commit comments

Comments
 (0)