mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
gstring reformatting fix
This commit is contained in:
@@ -100,6 +100,19 @@ public class GroovyBlockGenerator implements GroovyElementTypes {
|
||||
|
||||
}
|
||||
|
||||
//for gstrings
|
||||
if (block.getNode().getElementType() == GSTRING) {
|
||||
final ArrayList<Block> subBlocks = new ArrayList<Block>();
|
||||
ASTNode children[] = getGroovyChildren(node);
|
||||
ASTNode prevChildNode = null;
|
||||
for (ASTNode childNode : children) {
|
||||
final Indent indent = GroovyIndentProcessor.getChildIndent(block, prevChildNode, childNode);
|
||||
subBlocks.add(new GroovyBlock(childNode, myAlignment, indent, myWrap, mySettings));
|
||||
prevChildNode = childNode;
|
||||
}
|
||||
return subBlocks;
|
||||
}
|
||||
|
||||
//For nested selections
|
||||
if (NESTED.contains(block.getNode().getElementType()) &&
|
||||
blockPsi.getParent() != null &&
|
||||
|
||||
@@ -65,6 +65,7 @@ public class FormatterTest extends GroovyFormatterTestCase {
|
||||
public void testFor2() throws Throwable { doTest(); }
|
||||
public void testGbegin1() throws Throwable { doTest(); }
|
||||
public void testGrvy1637() throws Throwable { doTest(); }
|
||||
public void testGString1() throws Throwable { doTest(); }
|
||||
public void testMap6() throws Throwable { doTest(); }
|
||||
public void testMeth1() throws Throwable { doTest(); }
|
||||
public void testMeth2() throws Throwable { doTest(); }
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
def a = "${1+2} ${2}"
|
||||
-----
|
||||
def a = "${1 + 2} ${2}"
|
||||
Reference in New Issue
Block a user