Skip to content

Commit b542f5f

Browse files
zthcristianoc
authored andcommitted
slight cleanup
1 parent 6d198cc commit b542f5f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

analysis/src/CompletionFrontEnd.ml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -911,8 +911,9 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
911911
&& charBeforeCursor = Some ')') -> (
912912
(* Complete fn argument values and named args when the fn call is piped. E.g. someVar->someFn(<com>). *)
913913
let args = extractExpApplyArgs ~args in
914+
let funCtxPath = exprToContextPath funExpr in
914915
let argCompletable =
915-
match exprToContextPath funExpr with
916+
match funCtxPath with
916917
| Some contextPath ->
917918
findArgCompletables ~contextPath ~args
918919
~endPos:(Loc.end_ expr.pexp_loc) ~posBeforeCursor
@@ -923,7 +924,7 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
923924
in
924925
match argCompletable with
925926
| None -> (
926-
match exprToContextPath funExpr with
927+
match funCtxPath with
927928
| None -> ()
928929
| Some funCtxPath ->
929930
let oldCtxPath = !currentCtxPath in
@@ -955,8 +956,9 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
955956
(Loc.toString exp.pexp_loc))
956957
|> String.concat ", ");
957958

959+
let funCtxPath = exprToContextPath funExpr in
958960
let argCompletable =
959-
match exprToContextPath funExpr with
961+
match funCtxPath with
960962
| Some contextPath ->
961963
findArgCompletables ~contextPath ~args
962964
~endPos:(Loc.end_ expr.pexp_loc) ~posBeforeCursor
@@ -967,7 +969,7 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
967969
in
968970
match argCompletable with
969971
| None -> (
970-
match exprToContextPath funExpr with
972+
match funCtxPath with
971973
| None -> ()
972974
| Some funCtxPath ->
973975
let oldCtxPath = !currentCtxPath in

0 commit comments

Comments
 (0)