Live templates

How do I auto-generate all the cases in a switch statement? I'm sure I used to be able to do it, but can now only get a default case to be generated.


If I try typing "switch ]]>" I get to

switch( )


but after entering the variable to switch on I can't get the case statements generated.

2 comments
Comment actions Permalink

Hello,

How do I auto-generate all the cases in a switch statement? I'm sure
I used to be able to do it, but can now only get a default case to be
generated.


A Live Template cannot handle the variable set of "case"s. So there's a QuickFix
named "Generate Switch Labels", available thru a red bulb on the empty curly
braces after "switch()".

We've recently included Visual Studio live templates into our menu, so the
switch LT that gets executed is probably coming from that direction. We'll
see to either fully support or suppress it altogether.


Serge Baltic
JetBrains, Inc — http://www.jetbrains.com
“Develop with pleasure!”


0
Comment actions Permalink

Thanks, that was it. The live template confused me.

0

Please sign in to leave a comment.