Format for switch statements

Hi there ... :)

IS it possible to autogenerate a switch statement, with this format:

switch (x)
{

case 0:
{ // don't want the brace indented

break;
}


case 1:
{

break;
}


}

Rather than:

switch (x)
{

case 0:
{

break;
}


case 1:
{

break;
}


}

5 comments
Comment actions Permalink

How about "Live Templates" ?

0
Comment actions Permalink

That would do it, but the main problem is the formatting is done while I'm typing in the case statements.

A live template would do as a compromise though ...

0
Comment actions Permalink

"Rayz" <no_mail@jetbrains.com> wrote in message
news:4369703.1061748586810.JavaMail.itn@is.intellij.net...

Hi there ... :)

>

IS it possible to autogenerate a switch statement, with this format:

>

switch (x)
{

>

case 0:
{ // don't want the brace indented

>

break;
}


+10

I've been asking for this for a long, long time.

--
Jordan Zimmerman
http://www.jordanzimmerman.com


0
Comment actions Permalink

+I've been asking for this for a long, long time.
+

Really?

Is this format commonly used?

If it is, then perhaps JetBrains should look into supporting it.

0
Comment actions Permalink

It's a format that I use in my code upon occasion.

0

Please sign in to leave a comment.