You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Offer auto-completions for string literal unions while writing case statements #49945
I like the idea of having the option to add the default case; I'm not, however, a fan of "add exhaustive missing cases" as the name of the fix, since in reality both versions are exhaustive, the latter just adds an explicit check for exhaustiveness. If I see both fixes presented to me, I'm immediately going to wonder "What's the difference? Is the non-exhaustive version going to miss some cases or something?"
Activity
fatcerberus commentedon Jul 19, 2022
🚲 🏠
I like the idea of having the option to add the default case; I'm not, however, a fan of "add exhaustive missing cases" as the name of the fix, since in reality both versions are exhaustive, the latter just adds an explicit check for exhaustiveness. If I see both fixes presented to me, I'm immediately going to wonder "What's the difference? Is the non-exhaustive version going to miss some cases or something?"
orta commentedon Jul 19, 2022
This is a good argument 👍🏻 , it could be "add missing cases with never check'
heroboy commentedon Sep 23, 2022
try this: https://marketplace.visualstudio.com/items?itemName=heroboy.generate-switch-case-for-enum-type

gabritto commentedon Jan 16, 2023
Related: #50996 offers something along those lines, but only as a completion item.
DanielRosenwasser commentedon Mar 21, 2024
I think #50996 just fixed this in 5.0, right?