Skip to content

Commit 6e58726

Browse files
committed
slight cleanup
1 parent ad1b489 commit 6e58726

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

analysis/src/CompletionFrontEnd.ml

+6-4
Original file line numberDiff line numberDiff line change
@@ -907,8 +907,9 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
907907
&& charBeforeCursor = Some ')') -> (
908908
(* Complete fn argument values and named args when the fn call is piped. E.g. someVar->someFn(<com>). *)
909909
let args = extractExpApplyArgs ~args in
910+
let funCtxPath = exprToContextPath funExpr in
910911
let argCompletable =
911-
match exprToContextPath funExpr with
912+
match funCtxPath with
912913
| Some contextPath ->
913914
findArgCompletables ~contextPath ~args
914915
~endPos:(Loc.end_ expr.pexp_loc) ~posBeforeCursor
@@ -919,7 +920,7 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
919920
in
920921
match argCompletable with
921922
| None -> (
922-
match exprToContextPath funExpr with
923+
match funCtxPath with
923924
| None -> ()
924925
| Some funCtxPath ->
925926
let oldCtxPath = !currentCtxPath in
@@ -951,8 +952,9 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
951952
(Loc.toString exp.pexp_loc))
952953
|> String.concat ", ");
953954

955+
let funCtxPath = exprToContextPath funExpr in
954956
let argCompletable =
955-
match exprToContextPath funExpr with
957+
match funCtxPath with
956958
| Some contextPath ->
957959
findArgCompletables ~contextPath ~args
958960
~endPos:(Loc.end_ expr.pexp_loc) ~posBeforeCursor
@@ -963,7 +965,7 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
963965
in
964966
match argCompletable with
965967
| None -> (
966-
match exprToContextPath funExpr with
968+
match funCtxPath with
967969
| None -> ()
968970
| Some funCtxPath ->
969971
let oldCtxPath = !currentCtxPath in

0 commit comments

Comments
 (0)