Visual Studio: Can I automatically populate a switch with enum types?

When I’m creating a switch that will take a variable that’s an enum, is it possible to just automatically populate the whole switch with every enum value?

It would be a super-handy starting point, and seems like a logical prediction…

When you start typing switch, double-tap the TAB key, and it’ll auto populate the code snippet. It’ll have a temporary variable entry in the switch’s brackets. Put your enum in there, hit enter, and it’ll auto populate.

The double-tab TAB works for a lot of things. For loops, Foreach loops, etc.

5 Likes