Skip to content

Commit 303ffbf

Browse files
committed
get rid off option
1 parent f9ec1f5 commit 303ffbf

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

analysis/src/CompletionBackEnd.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ let printConstructorArgs argsLen ~asSnippet =
10471047
if List.length !args > 0 then "(" ^ (!args |> String.concat ", ") ^ ")"
10481048
else ""
10491049

1050-
type completionMode = Pattern of Completable.patternMode option | Expression
1050+
type completionMode = Pattern of Completable.patternMode | Expression
10511051

10521052
let rec completeTypedValue ~full ~prefix ~completionContext ~mode
10531053
(t : SharedTypes.completionType) =
@@ -1143,7 +1143,7 @@ let rec completeTypedValue ~full ~prefix ~completionContext ~mode
11431143
List.mem field.fname.txt seenFields = false)
11441144
|> List.map (fun (field : field) ->
11451145
match (field.optional, mode) with
1146-
| true, Pattern (Some Destructuring) ->
1146+
| true, Pattern Destructuring ->
11471147
Completion.create ("?" ^ field.fname.txt)
11481148
~docstring:
11491149
[

analysis/src/CompletionFrontEnd.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
317317
prefix;
318318
nested = List.rev nestedPattern;
319319
fallback = None;
320-
patternMode = None;
320+
patternMode = Default;
321321
})
322322
| _ -> ()
323323
in
@@ -392,7 +392,7 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
392392
nested = [];
393393
prefix = "";
394394
fallback = None;
395-
patternMode = None;
395+
patternMode = Default;
396396
}))
397397
| Pexp_match (exp, cases) -> (
398398
(* If there's more than one case, or the case isn't a pattern hole, figure out if we're completing another
@@ -425,7 +425,7 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
425425
nested = [];
426426
prefix = "";
427427
fallback = None;
428-
patternMode = None;
428+
patternMode = Default;
429429
})
430430
| false, false -> ()))
431431
| _ -> unsetLookingForPat ()
@@ -527,7 +527,7 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
527527
prefix;
528528
nested = List.rev nested;
529529
fallback = None;
530-
patternMode = Some Destructuring;
530+
patternMode = Destructuring;
531531
})
532532
| _ -> ())
533533
| _ -> ());

analysis/src/SharedTypes.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ module Completable = struct
631631
^ ")"
632632
| NArray -> "array"
633633

634-
type patternMode = Destructuring
634+
type patternMode = Default | Destructuring
635635

636636
type t =
637637
| Cdecorator of string (** e.g. @module *)
@@ -650,7 +650,7 @@ module Completable = struct
650650
contextPath: contextPath;
651651
nested: nestedPath list;
652652
prefix: string;
653-
patternMode: patternMode option;
653+
patternMode: patternMode;
654654
fallback: t option;
655655
}
656656
| CexhaustiveSwitch of {contextPath: contextPath; exprLoc: Location.t}

0 commit comments

Comments
 (0)