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