@@ -736,14 +736,14 @@ and getCompletionsForContextPath ~full ~opens ~rawOpens ~allFiles ~pos ~env
736
736
|> getCompletionsForPath ~package ~opens ~all Files ~pos ~exact
737
737
~completion Context ~env ~scope
738
738
| CPApply (cp , labels ) -> (
739
- (* TODO: Also needs to support ExtractedType *)
740
739
match
741
740
cp
742
741
|> getCompletionsForContextPath ~full ~opens ~raw Opens ~all Files ~pos ~env
743
742
~exact: true ~scope
744
- |> completionsGetTypeEnv2 ~full ~opens ~raw Opens ~all Files ~pos ~scope
743
+ |> completionsGetCompletionType2 ~full ~opens ~raw Opens ~all Files ~pos
744
+ ~scope
745
745
with
746
- | Some (typ , env ) -> (
746
+ | Some (( TypeExpr typ | ExtractedType (Tfunction {typ} )) , env ) -> (
747
747
let rec reconstructFunctionType args tRet =
748
748
match args with
749
749
| [] -> tRet
@@ -776,7 +776,7 @@ and getCompletionsForContextPath ~full ~opens ~rawOpens ~allFiles ~pos ~env
776
776
let retType = reconstructFunctionType args tRet in
777
777
[Completion. create " dummy" ~env ~kind: (Completion. Value retType)]
778
778
| _ -> [] )
779
- | None -> [])
779
+ | _ -> [])
780
780
| CPField (CPId (path , Module), fieldName ) ->
781
781
(* M.field *)
782
782
path @ [fieldName]
@@ -1048,16 +1048,17 @@ and getCompletionsForContextPath ~full ~opens ~rawOpens ~allFiles ~pos ~env
1048
1048
~kind: (Completion. Value (Utils. unwrapIfOption typ));
1049
1049
])
1050
1050
| CArgument {functionContextPath; argumentLabel} -> (
1051
- (* TODO: Also needs to support ExtractedType *)
1052
1051
let labels, env =
1053
1052
match
1054
1053
functionContextPath
1055
1054
|> getCompletionsForContextPath ~full ~opens ~raw Opens ~all Files ~pos
1056
1055
~env ~exact: true ~scope
1057
- |> completionsGetTypeEnv2 ~full ~opens ~raw Opens ~all Files ~pos ~scope
1056
+ |> completionsGetCompletionType2 ~full ~opens ~raw Opens ~all Files ~pos
1057
+ ~scope
1058
1058
with
1059
- | Some (typ , env ) -> (typ |> TypeUtils. getArgs ~full ~env , env)
1060
- | None -> ([] , env)
1059
+ | Some ((TypeExpr typ | ExtractedType (Tfunction {typ} )), env ) ->
1060
+ (typ |> TypeUtils. getArgs ~full ~env , env)
1061
+ | _ -> ([] , env)
1061
1062
in
1062
1063
let targetLabel =
1063
1064
labels
0 commit comments