Formatting If Statements
Has anyone found a combination of formatting options that will turn:
if (2 < 3) { return; } else if (2 > 3) { return; } else { return; }
Into
if (2 < 3) return; else if (2 > 3) return; else return;
Of course never this:
if (2 < 3) if (2 > 3) return; else return;
Which should always be bracketed
if (2 < 3) {
if (2 > 3) return; else return;
}
请先登录再写评论。
Hi Jon,
No, IJ formatter doesn't provide an ability to remove curly braces.
Denis
Hi Dennis,
Thanks for the reply.
Let me give you a better view as to what I mean:
So, right now it looks like:
and I would like:
Sorry, my original question was misleading I think. I just want to prevent the else clauses getting folded up while still keeping "Control statements one line".
Well, combinations of two settings below make that possible:
Regards, Denis
Hi Denis,
I opened a ticket since I think it is not possible at the moment.
http://youtrack.jetbrains.com/issue/IDEA-97107