roslyn
roslyn copied to clipboard
Switch expression pattern is not using suggestion mode
Version Used: Version 17.0.0 Preview 3.0 [31519.82.main] (I think this is a recent break)
Steps to Reproduce:
- Create a new console app.
- Type
_ = args switch { $$ }
(cursor at $$) - Type
_<space>
Expected Behavior:
_
is kept.
Actual Behavior:
#if
is inserted (or whatever is top of your completion list).
Here's a different example:
Note: we likely shouldn't be in suggestion mode here. What we should be doing is adding the 'discard symbol' (_
) to the completion list so that this just counts as a real match with normal completion semantics.
@jinujoseph i think we should not have this in the backlog. it's a pretty unpleasant experience typing a reasonable code construct.
cc @genlu fyi
jinujoseph i think we should not have this in the backlog. it's a pretty unpleasant experience typing a reasonable code construct.
I would go as far as to say it's the most common switch expression pattern. Just about every switch expression I type has one, and this bug has bit me nearly a double-digit number of times today.
I don't repro this anymore. We don't seem to hard select: