@@ -726,14 +726,14 @@ and getCompletionsForContextPath ~full ~opens ~rawOpens ~allFiles ~pos ~env
726
726
|> getCompletionsForPath ~package ~opens ~all Files ~pos ~exact
727
727
~completion Context ~env ~scope
728
728
| CPApply (cp , labels ) -> (
729
- (* TODO: Also needs to support ExtractedType *)
730
729
match
731
730
cp
732
731
|> getCompletionsForContextPath ~full ~opens ~raw Opens ~all Files ~pos ~env
733
732
~exact: true ~scope
734
- |> completionsGetTypeEnv2 ~full ~opens ~raw Opens ~all Files ~pos ~scope
733
+ |> completionsGetCompletionType2 ~full ~opens ~raw Opens ~all Files ~pos
734
+ ~scope
735
735
with
736
- | Some (typ , env ) -> (
736
+ | Some (( TypeExpr typ | ExtractedType (Tfunction {typ} )) , env ) -> (
737
737
let rec reconstructFunctionType args tRet =
738
738
match args with
739
739
| [] -> tRet
@@ -766,7 +766,7 @@ and getCompletionsForContextPath ~full ~opens ~rawOpens ~allFiles ~pos ~env
766
766
let retType = reconstructFunctionType args tRet in
767
767
[Completion. create " dummy" ~env ~kind: (Completion. Value retType)]
768
768
| _ -> [] )
769
- | None -> [])
769
+ | _ -> [])
770
770
| CPField (CPId (path , Module), fieldName ) ->
771
771
(* M.field *)
772
772
path @ [fieldName]
@@ -1038,16 +1038,17 @@ and getCompletionsForContextPath ~full ~opens ~rawOpens ~allFiles ~pos ~env
1038
1038
~kind: (Completion. Value (Utils. unwrapIfOption typ));
1039
1039
])
1040
1040
| CArgument {functionContextPath; argumentLabel} -> (
1041
- (* TODO: Also needs to support ExtractedType *)
1042
1041
let labels, env =
1043
1042
match
1044
1043
functionContextPath
1045
1044
|> getCompletionsForContextPath ~full ~opens ~raw Opens ~all Files ~pos
1046
1045
~env ~exact: true ~scope
1047
- |> completionsGetTypeEnv2 ~full ~opens ~raw Opens ~all Files ~pos ~scope
1046
+ |> completionsGetCompletionType2 ~full ~opens ~raw Opens ~all Files ~pos
1047
+ ~scope
1048
1048
with
1049
- | Some (typ , env ) -> (typ |> TypeUtils. getArgs ~full ~env , env)
1050
- | None -> ([] , env)
1049
+ | Some ((TypeExpr typ | ExtractedType (Tfunction {typ} )), env ) ->
1050
+ (typ |> TypeUtils. getArgs ~full ~env , env)
1051
+ | _ -> ([] , env)
1051
1052
in
1052
1053
let targetLabel =
1053
1054
labels
0 commit comments