@@ -1502,7 +1502,8 @@ let rec extractType ~env ~package (t : Types.type_expr) =
1502
1502
| Ttuple expressions -> Some (Tuple (env, expressions))
1503
1503
| _ -> None
1504
1504
1505
- let completeTypedValue ~env ~full ~prefix ~expandOption =
1505
+ let completeTypedValue ~env ~envWhereCompletionStarted ~full ~prefix
1506
+ ~expandOption =
1506
1507
let namesUsed = Hashtbl. create 10 in
1507
1508
let rec completeTypedValueInner t ~env ~full ~prefix ~expandOption =
1508
1509
let items =
@@ -1575,8 +1576,10 @@ let completeTypedValue ~env ~full ~prefix ~expandOption =
1575
1576
if prefix = " " then items
1576
1577
else
1577
1578
items
1578
- @ completionForExportedValues ~env ~prefix ~exact: false ~names Used
1579
- @ completionForExportedModules ~env ~prefix ~exact: false ~names Used
1579
+ @ completionForExportedValues ~env: envWhereCompletionStarted ~prefix
1580
+ ~exact: false ~names Used
1581
+ @ completionForExportedModules ~env: envWhereCompletionStarted ~prefix
1582
+ ~exact: false ~names Used
1580
1583
in
1581
1584
completeTypedValueInner ~env ~full ~prefix ~expand Option
1582
1585
@@ -1943,6 +1946,7 @@ Note: The `@react.component` decorator requires the react-jsx config to be set i
1943
1946
(dec2 , doc ))
1944
1947
|> List. map mkDecorator
1945
1948
| Cargument {functionContextPath; argumentLabel; prefix} -> (
1949
+ let envWhereCompletionStarted = env in
1946
1950
let labels =
1947
1951
match
1948
1952
functionContextPath
@@ -1959,9 +1963,13 @@ Note: The `@react.component` decorator requires the react-jsx config to be set i
1959
1963
match targetLabel with
1960
1964
| None -> []
1961
1965
| Some (Labelled _ , typ ) ->
1962
- typ |> completeTypedValue ~env ~full ~prefix ~expandOption :true
1966
+ typ
1967
+ |> completeTypedValue ~env ~envWhereCompletionStarted ~full ~prefix
1968
+ ~expandOption :true
1963
1969
| Some (Unlabelled _ , typ ) ->
1964
- typ |> completeTypedValue ~env ~full ~prefix ~expandOption :false )
1970
+ typ
1971
+ |> completeTypedValue ~env ~envWhereCompletionStarted ~full ~prefix
1972
+ ~expandOption :false )
1965
1973
| CnamedArg (cp , prefix , identsSeen ) ->
1966
1974
let labels =
1967
1975
match
0 commit comments