Skip to content

Commit 8c59cae

Browse files
committed
fix
1 parent d71a5bc commit 8c59cae

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

analysis/src/CompletionBackEnd.ml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -726,14 +726,14 @@ and getCompletionsForContextPath ~full ~opens ~rawOpens ~allFiles ~pos ~env
726726
|> getCompletionsForPath ~package ~opens ~allFiles ~pos ~exact
727727
~completionContext ~env ~scope
728728
| CPApply (cp, labels) -> (
729-
(* TODO: Also needs to support ExtractedType *)
730729
match
731730
cp
732731
|> getCompletionsForContextPath ~full ~opens ~rawOpens ~allFiles ~pos ~env
733732
~exact:true ~scope
734-
|> completionsGetTypeEnv2 ~full ~opens ~rawOpens ~allFiles ~pos ~scope
733+
|> completionsGetCompletionType2 ~full ~opens ~rawOpens ~allFiles ~pos
734+
~scope
735735
with
736-
| Some (typ, env) -> (
736+
| Some ((TypeExpr typ | ExtractedType (Tfunction {typ})), env) -> (
737737
let rec reconstructFunctionType args tRet =
738738
match args with
739739
| [] -> tRet
@@ -766,7 +766,7 @@ and getCompletionsForContextPath ~full ~opens ~rawOpens ~allFiles ~pos ~env
766766
let retType = reconstructFunctionType args tRet in
767767
[Completion.create "dummy" ~env ~kind:(Completion.Value retType)]
768768
| _ -> [])
769-
| None -> [])
769+
| _ -> [])
770770
| CPField (CPId (path, Module), fieldName) ->
771771
(* M.field *)
772772
path @ [fieldName]
@@ -1038,16 +1038,17 @@ and getCompletionsForContextPath ~full ~opens ~rawOpens ~allFiles ~pos ~env
10381038
~kind:(Completion.Value (Utils.unwrapIfOption typ));
10391039
])
10401040
| CArgument {functionContextPath; argumentLabel} -> (
1041-
(* TODO: Also needs to support ExtractedType *)
10421041
let labels, env =
10431042
match
10441043
functionContextPath
10451044
|> getCompletionsForContextPath ~full ~opens ~rawOpens ~allFiles ~pos
10461045
~env ~exact:true ~scope
1047-
|> completionsGetTypeEnv2 ~full ~opens ~rawOpens ~allFiles ~pos ~scope
1046+
|> completionsGetCompletionType2 ~full ~opens ~rawOpens ~allFiles ~pos
1047+
~scope
10481048
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)
10511052
in
10521053
let targetLabel =
10531054
labels

0 commit comments

Comments
 (0)