Strange Groovy Formatting issue

'lo all,

A coworker pointed out last night some really strange groovy formatting issues in IDEA 9:

int i = 5;
if (i == 1) {
    println i;

}
else if (i == 2) {
    println i;
}
else if (i == 3){
       
    }


The problem seems to be in the multiple 'else if' blocks.  If the code read "else { if..... }" the formatting seems to work fine.  Is there any reason why this code is getting a strange indent on the second else if?   ( The actual code in question had 4-5 'else if' blocks and was getting indented for each - which looks rather ugly.

1 comment
Comment actions Permalink

Hi Mark,

Looks very similar to this issue for java formatter - IDEA-25842 (already fixed).

Suppose Groovy formatter suffers from the same problem. Feel free to submit corresponding request about that to IDEA tracker.

Regards, Denis

0

Please sign in to leave a comment.