@@ -907,8 +907,9 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
907
907
&& charBeforeCursor = Some ')' ) -> (
908
908
(* Complete fn argument values and named args when the fn call is piped. E.g. someVar->someFn(<com>). *)
909
909
let args = extractExpApplyArgs ~args in
910
+ let funCtxPath = exprToContextPath funExpr in
910
911
let argCompletable =
911
- match exprToContextPath funExpr with
912
+ match funCtxPath with
912
913
| Some contextPath ->
913
914
findArgCompletables ~context Path ~args
914
915
~end Pos:(Loc. end_ expr.pexp_loc) ~pos BeforeCursor
@@ -919,7 +920,7 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
919
920
in
920
921
match argCompletable with
921
922
| None -> (
922
- match exprToContextPath funExpr with
923
+ match funCtxPath with
923
924
| None -> ()
924
925
| Some funCtxPath ->
925
926
let oldCtxPath = ! currentCtxPath in
@@ -951,8 +952,9 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
951
952
(Loc. toString exp.pexp_loc))
952
953
|> String. concat " , " );
953
954
955
+ let funCtxPath = exprToContextPath funExpr in
954
956
let argCompletable =
955
- match exprToContextPath funExpr with
957
+ match funCtxPath with
956
958
| Some contextPath ->
957
959
findArgCompletables ~context Path ~args
958
960
~end Pos:(Loc. end_ expr.pexp_loc) ~pos BeforeCursor
@@ -963,7 +965,7 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
963
965
in
964
966
match argCompletable with
965
967
| None -> (
966
- match exprToContextPath funExpr with
968
+ match funCtxPath with
967
969
| None -> ()
968
970
| Some funCtxPath ->
969
971
let oldCtxPath = ! currentCtxPath in
0 commit comments