diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/blocks/GroovyBlockGenerator.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/blocks/GroovyBlockGenerator.java index bba144184a7a..8a98eeff03ea 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/blocks/GroovyBlockGenerator.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/blocks/GroovyBlockGenerator.java @@ -405,7 +405,7 @@ public class GroovyBlockGenerator implements GroovyElementTypes { PsiElement psi = child.getPsi(); if (psi instanceof GrLabeledStatement) { alignGroup(currentGroup, spock, classLevel); - currentGroup = ContainerUtil.newArrayList(/*(GrStatement)psi*/); + currentGroup = ContainerUtil.newArrayList(); spock = true; } else if (currentGroup != null && spock && isTablePart(psi)) { @@ -428,6 +428,10 @@ public class GroovyBlockGenerator implements GroovyElementTypes { currentGroup = null; } } + + if (currentGroup != null) { + alignGroup(currentGroup, spock, classLevel); + } } private boolean shouldSkip(boolean classLevel, PsiElement psi) {