IDEA-122398 all wraps inside plain GString injections should be NONE

This commit is contained in:
Max Medvedev
2014-03-19 12:48:31 +04:00
parent cc7c165825
commit 4cd7b8a0ec
3 changed files with 8 additions and 2 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -237,7 +237,8 @@ public class GroovyWrappingProcessor {
}
public Wrap getChainedMethodCallWrap() {
return Wrap.createWrap(mySettings.METHOD_CALL_CHAIN_WRAP, false);
return myContext.isInsidePlainGString() ? Wrap.createWrap(WrapType.NONE, false)
: Wrap.createWrap(mySettings.METHOD_CALL_CHAIN_WRAP, false);
}
private TokenSet ANNOTATION_CONTAINERS = TokenSet.create(
@@ -798,6 +798,8 @@ def foo() {
}
}
void testNoLineFeedsInGString() { doTest() }
private void doGeeseTest() {
GroovyCodeStyleSettings customSettings = myTempSettings.getCustomSettings(GroovyCodeStyleSettings.class)
boolean oldvalue = customSettings.USE_FLYING_GEESE_BRACES
@@ -0,0 +1,3 @@
print " {left(email.user?.raw, (length / 2).toInteger())}@${left(email.domain?.raw, (length - length / 2 - 1).toInteger())}"
-----
print " {left(email.user?.raw, (length / 2).toInteger())}@${left(email.domain?.raw, (length - length / 2 - 1).toInteger())}"