From ed39848efd39c6309a7d6a6054bebee810a4649e Mon Sep 17 00:00:00 2001 From: Max Medvedev Date: Tue, 4 Mar 2014 15:49:10 +0400 Subject: [PATCH] IDEA-121140 format spock tables in the end of a file --- .../groovy/formatter/blocks/GroovyBlockGenerator.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) {