File tree Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -1542,6 +1542,22 @@ let completeTypedValue t ~env ~full ~prefix =
1542
1542
~env ))
1543
1543
in
1544
1544
items
1545
+ | Some (Toption (env , t )) ->
1546
+ let items =
1547
+ [
1548
+ Completion. create ~name: " None"
1549
+ ~kind: (Label (t |> Shared. typeToString))
1550
+ ~env ;
1551
+ Completion. create ~name: " Some(_)"
1552
+ ~kind: (Label (t |> Shared. typeToString))
1553
+ ~env ;
1554
+ ]
1555
+ in
1556
+ if prefix = " " then items
1557
+ else
1558
+ items
1559
+ |> List. filter (fun (item : Completion.t ) ->
1560
+ Utils. startsWith item.name prefix)
1545
1561
| _ -> []
1546
1562
1547
1563
let processCompletable ~debug ~full ~scope ~env ~pos ~forHover
Original file line number Diff line number Diff line change @@ -32,7 +32,19 @@ Complete src/CompletionFunctionArguments.res 14:25
32
32
posCursor:[14:25] posNoWhite:[14:24] Found expr:[14:11->14:26]
33
33
Pexp_apply ...[14:11->14:17] (~isOff14:19->14:24=...__ghost__[0:-1->0:-1])
34
34
Completable: Value[someFn](~isOff)
35
- []
35
+ [{
36
+ "label": "None",
37
+ "kind": 4,
38
+ "tags": [],
39
+ "detail": "bool",
40
+ "documentation": null
41
+ }, {
42
+ "label": "Some(_)",
43
+ "kind": 4,
44
+ "tags": [],
45
+ "detail": "bool",
46
+ "documentation": null
47
+ }]
36
48
37
49
Complete src/CompletionFunctionArguments.res 19:27
38
50
posCursor:[19:27] posNoWhite:[19:26] Found expr:[17:8->23:1]
@@ -108,7 +120,13 @@ Complete src/CompletionFunctionArguments.res 50:32
108
120
posCursor:[50:32] posNoWhite:[50:31] Found expr:[50:11->50:33]
109
121
Pexp_apply ...[50:11->50:30] (...[50:31->50:32])
110
122
Completable: Value[someFnTakingVariant]($0=S)
111
- []
123
+ [{
124
+ "label": "Some(_)",
125
+ "kind": 4,
126
+ "tags": [],
127
+ "detail": "someVariant",
128
+ "documentation": null
129
+ }]
112
130
113
131
Complete src/CompletionFunctionArguments.res 53:43
114
132
posCursor:[53:43] posNoWhite:[53:42] Found expr:[53:11->53:44]
You can’t perform that action at this time.
0 commit comments