Reputation: 16656
I can't find key binding to expand all possible cases in switch, eg. have switch with enum argument, in Borland C++ i doing this with TAB key while switch code is selected.
I want to do this in Visual Studio 2010.
Can anyone help me?
Upvotes: 7
Views: 7681
Reputation: 190
I often use Switch with enums. JaredPar's answer is good, but it doesn't work for me (possibly because i am using ReSharper).
What is working for me: after creating a Switch statement based on some enum, i click my mouse at begining of word "Switch", then i press ALT+ENTER and select "Add switch statement for bla-bla-bla...". This will generate all cases for all possible enum values.
Upvotes: 0
Reputation: 1703
I had the same issue and it was duo to resharper installation which does it differently.
after entering the switch and the parameter place the curser in the switch body and then you need to click on the lamp icon on the left or clicking Alt+Enter.
Upvotes: 0
Reputation: 755259
It C++ it's not possible to do this. The IDE just doesn't have support for that operation.
In C# you can do this with the switch code snippet:
This will expand out the known cases into the IDE.
Upvotes: 16