Skip to content

Commit 37cd3db

Browse files
committed
comment
1 parent a3e1da9 commit 37cd3db

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

analysis/src/CompletionFrontEnd.ml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,12 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor ~text =
695695
match orPatWithItem with
696696
| None when isPatternHole p1 || isPatternHole p2 -> Some ("", patternPath)
697697
| 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)
699704
| Ppat_var {txt} -> someIfHasCursor (txt, patternPath)
700705
| Ppat_construct ({txt = Lident "()"}, None) ->
701706
(* switch s { | (<com>) }*)

0 commit comments

Comments
 (0)