File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -695,7 +695,12 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
695
695
match orPatWithItem with
696
696
| None when isPatternHole p1 || isPatternHole p2 -> Some (" " , patternPath)
697
697
| v -> v)
698
- | Ppat_any -> someIfHasCursor (" " , patternPath)
698
+ | Ppat_any ->
699
+ (* We treat any `_` as an empty completion. This is mainly because we're
700
+ inserting `_` in snippets and automatically put the cursor there. So
701
+ letting it trigger an empty completion improves the ergonomics by a
702
+ lot. *)
703
+ someIfHasCursor (" " , patternPath)
699
704
| Ppat_var {txt} -> someIfHasCursor (txt, patternPath)
700
705
| Ppat_construct ({txt = Lident "()" } , None) ->
701
706
(* switch s { | (<com>) }*)
You can’t perform that action at this time.
0 commit comments