Formatter: now always adds space between reference expression and function literal. Test is included.
#KT-3932 fixed
This commit is contained in:
@@ -113,6 +113,8 @@ public class JetFormattingModelBuilder implements FormattingModelBuilder {
|
|||||||
.beforeInside(LBRACE, WHEN).spacing(1, 1, 0, true, 0) //omit blank lines before '{' in 'when' statement
|
.beforeInside(LBRACE, WHEN).spacing(1, 1, 0, true, 0) //omit blank lines before '{' in 'when' statement
|
||||||
|
|
||||||
.aroundInside(ARROW, FUNCTION_TYPE).spaceIf(jetSettings.SPACE_AROUND_FUNCTION_TYPE_ARROW)
|
.aroundInside(ARROW, FUNCTION_TYPE).spaceIf(jetSettings.SPACE_AROUND_FUNCTION_TYPE_ARROW)
|
||||||
|
|
||||||
|
.betweenInside(REFERENCE_EXPRESSION, FUNCTION_LITERAL_EXPRESSION, CALL_EXPRESSION).spaces(1)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fun f() {
|
||||||
|
array(1, 2, 3).map{ v -> v }
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fun f() {
|
||||||
|
array(1, 2, 3).map { v -> v }
|
||||||
|
}
|
||||||
@@ -147,6 +147,10 @@ public class JetFormatterTest extends AbstractJetFormatterTest {
|
|||||||
doTestWithInvert();
|
doTestWithInvert();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testReferenceExpressionFunctionLiteral() throws Exception {
|
||||||
|
doTest();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doTest() throws Exception {
|
public void doTest() throws Exception {
|
||||||
String originalFileText = AbstractJetFormatterTest.loadFile(getTestName(false) + ".kt");
|
String originalFileText = AbstractJetFormatterTest.loadFile(getTestName(false) + ".kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user