Skip to content

Commit c5b6d1d

Browse files
committed
nested tuple
1 parent 59e555d commit c5b6d1d

File tree

2 files changed

+39
-16
lines changed

2 files changed

+39
-16
lines changed

analysis/tests/src/CompletionPattern.res

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
let v = (true, Some(false))
1+
let v = (true, Some(false), (true, true))
2+
3+
let _ = switch v {
4+
| (true, _, _) => 1
5+
| _ => 2
6+
}
27

38
// switch v {
49
// ^com
@@ -9,6 +14,9 @@ let v = (true, Some(false))
914
// switch v { | (t, _) }
1015
// ^com
1116

17+
// switch v { | (_, _, (f, _)) }
18+
// ^com
19+
1220
let x = true
1321

1422
// switch x { |

analysis/tests/src/expected/CompletionPattern.res.txt

+30-15
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
Complete src/CompletionPattern.res 2:13
2-
posCursor:[2:13] posNoWhite:[2:12] Found expr:[2:3->2:13]
1+
Complete src/CompletionPattern.res 7:13
2+
posCursor:[7:13] posNoWhite:[7:12] Found expr:[7:3->7:13]
33
[]
44

5-
Complete src/CompletionPattern.res 5:15
5+
Complete src/CompletionPattern.res 10:15
66
XXX Not found!
77
Completable: Cpattern Value[v]
88
[{
9-
"label": "(_, _)",
9+
"label": "(_, _, _)",
1010
"kind": 12,
1111
"tags": [],
12-
"detail": "(bool, option<bool>)",
12+
"detail": "(bool, option<bool>, (bool, bool))",
1313
"documentation": null,
14-
"insertText": "(${1:_}, ${2:_})",
14+
"insertText": "(${1:_}, ${2:_}, ${3:_})",
1515
"insertTextFormat": 2
1616
}]
1717

18-
Complete src/CompletionPattern.res 8:18
18+
Complete src/CompletionPattern.res 13:18
1919
looking for: Cpath Value[v]
20-
posCursor:[8:18] posNoWhite:[8:17] Found expr:[8:3->8:24]
21-
posCursor:[8:18] posNoWhite:[8:17] Found pattern:[8:16->8:22]
22-
posCursor:[8:18] posNoWhite:[8:17] Found pattern:[8:17->8:18]
20+
posCursor:[13:18] posNoWhite:[13:17] Found expr:[13:3->13:24]
21+
posCursor:[13:18] posNoWhite:[13:17] Found pattern:[13:16->13:22]
22+
posCursor:[13:18] posNoWhite:[13:17] Found pattern:[13:17->13:18]
2323
Completable: Cpattern Value[v]=t->tuple($0)
2424
[{
2525
"label": "true",
@@ -29,14 +29,29 @@ Completable: Cpattern Value[v]=t->tuple($0)
2929
"documentation": null
3030
}]
3131

32-
Complete src/CompletionPattern.res 13:16
33-
posCursor:[13:16] posNoWhite:[13:14] Found expr:[13:3->13:15]
32+
Complete src/CompletionPattern.res 16:25
33+
looking for: Cpath Value[v]
34+
posCursor:[16:25] posNoWhite:[16:24] Found expr:[16:3->16:32]
35+
posCursor:[16:25] posNoWhite:[16:24] Found pattern:[16:16->16:30]
36+
posCursor:[16:25] posNoWhite:[16:24] Found pattern:[16:23->16:29]
37+
posCursor:[16:25] posNoWhite:[16:24] Found pattern:[16:24->16:25]
38+
Completable: Cpattern Value[v]=f->tuple($2), tuple($0)
39+
[{
40+
"label": "false",
41+
"kind": 4,
42+
"tags": [],
43+
"detail": "bool",
44+
"documentation": null
45+
}]
46+
47+
Complete src/CompletionPattern.res 21:16
48+
posCursor:[21:16] posNoWhite:[21:14] Found expr:[21:3->21:15]
3449
[]
3550

36-
Complete src/CompletionPattern.res 16:17
51+
Complete src/CompletionPattern.res 24:17
3752
looking for: Cpath Value[x]
38-
posCursor:[16:17] posNoWhite:[16:16] Found expr:[16:3->16:17]
39-
posCursor:[16:17] posNoWhite:[16:16] Found pattern:[16:16->16:17]
53+
posCursor:[24:17] posNoWhite:[24:16] Found expr:[24:3->24:17]
54+
posCursor:[24:17] posNoWhite:[24:16] Found pattern:[24:16->24:17]
4055
Completable: Cpattern Value[x]=t
4156
[{
4257
"label": "true",

0 commit comments

Comments
 (0)