I was typing a switch with an enum in VS 2013 and all case statements filled out automatically after I finished the switch. Now I can\'t repeat it. I was not hallucinating,
The selected answer is mostly correct, you don't need Resharper as other's have suggested (at least not with Visual Studio Professional 2012+).
1) type "sw" then "[tab][tab]" (as Marvin Smit
said)
Which (as jmblack
said) will generate something like:
switch (switch_on)
{
default:
}
but then
2) you need to select which thing to enumerate on (switch_on
will be highlighted still at this point). So type in the Enum (or your variable of the enum type) while switch_on
is highlited and hit [Enter][Enter].
(I just confirmed this worked on my machine running VS2012, and i'm fairly certain this is the same thing i have done on my other machine running VS2013, and i haven't tested other versions of VS (ultimate/express/etc.))