File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -711,26 +711,28 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
711
711
match exp |> exprToContextPath with
712
712
| None -> ()
713
713
| Some ctxPath -> (
714
- let caseWithCursor =
714
+ let hasCaseWithCursor =
715
715
cases
716
716
|> List. find_opt (fun case ->
717
717
case.Parsetree. pc_lhs.ppat_loc
718
718
|> CursorPosition. classifyLoc ~pos: posBeforeCursor
719
719
= HasCursor )
720
+ |> Option. is_some
720
721
in
721
- let caseWithPatHole =
722
+ let hasCaseWithPatHole =
722
723
cases
723
724
|> List. find_opt (fun case -> isPatternHole case.Parsetree. pc_lhs)
725
+ |> Option. is_some
724
726
in
725
- match (caseWithPatHole, caseWithCursor ) with
726
- | _ , Some _ ->
727
+ match (hasCaseWithPatHole, hasCaseWithCursor ) with
728
+ | _ , true ->
727
729
(* Always continue if there's a case with the cursor *)
728
730
setLookingForPat ctxPath
729
- | Some _ , None ->
731
+ | true , false ->
730
732
(* If there's no case with the cursor, but a broken parser case, complete for the top level. *)
731
733
setResult
732
734
(Completable. Cpattern {typ = ctxPath; nested = [] ; prefix = " " })
733
- | None , None -> () ))
735
+ | false , false -> () ))
734
736
| _ -> unsetLookingForPat ()
735
737
in
736
738
You can’t perform that action at this time.
0 commit comments