File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -1509,8 +1509,10 @@ let rec extractType ~env ~package (t : Types.type_expr) =
1509
1509
| Ttuple expressions -> Some (Tuple (env, expressions))
1510
1510
| _ -> None
1511
1511
1512
- let completeTypedValue t ~env ~full ~prefix =
1512
+ let rec completeTypedValue t ~env ~full ~prefix ~ expandOption =
1513
1513
match t |> extractType ~env ~package: full.package with
1514
+ | Some (Toption (env , typ )) when expandOption ->
1515
+ typ |> completeTypedValue ~env ~full ~prefix ~expand Option:false
1514
1516
| Some (Tbool env ) ->
1515
1517
let items =
1516
1518
[
@@ -1938,7 +1940,10 @@ Note: The `@react.component` decorator requires the react-jsx config to be set i
1938
1940
in
1939
1941
match targetLabel with
1940
1942
| None -> []
1941
- | Some (_ , typ ) -> typ |> completeTypedValue ~env ~full ~prefix )
1943
+ | Some (Labelled _ , typ ) ->
1944
+ typ |> completeTypedValue ~env ~full ~prefix ~expandOption :true
1945
+ | Some (Unlabelled _ , typ ) ->
1946
+ typ |> completeTypedValue ~env ~full ~prefix ~expandOption :false )
1942
1947
| CnamedArg (cp , prefix , identsSeen ) ->
1943
1948
let labels =
1944
1949
match
Original file line number Diff line number Diff line change @@ -33,13 +33,13 @@ 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 ",
36
+ "label": "true ",
37
37
"kind": 4,
38
38
"tags": [],
39
39
"detail": "bool",
40
40
"documentation": null
41
41
}, {
42
- "label": "Some(_) ",
42
+ "label": "false ",
43
43
"kind": 4,
44
44
"tags": [],
45
45
"detail": "bool",
@@ -138,5 +138,11 @@ Complete src/CompletionFunctionArguments.res 56:44
138
138
posCursor:[56:44] posNoWhite:[56:43] Found expr:[56:11->56:45]
139
139
Pexp_apply ...[56:11->56:30] (~configOpt256:32->56:42=...[56:43->56:44])
140
140
Completable: Value[someFnTakingVariant](~configOpt2=O)
141
- []
141
+ [{
142
+ "label": "One",
143
+ "kind": 4,
144
+ "tags": [],
145
+ "detail": "One\n\n",
146
+ "documentation": null
147
+ }]
142
148
You can’t perform that action at this time.
0 commit comments