Formatter: handle spaces before value arguments list (KT-12634)

#KT-12634 Fixed
This commit is contained in:
Kirill Rakhman
2016-06-06 18:39:10 +02:00
committed by Nikolay Krasko
parent 922dc85e11
commit 5c68681f96
17 changed files with 26 additions and 13 deletions
@@ -226,6 +226,7 @@ fun createSpacingBuilder(settings: CodeStyleSettings, builderUtil: KotlinSpacing
aroundInside(ARROW, FUNCTION_TYPE).spaceIf(kotlinSettings.SPACE_AROUND_FUNCTION_TYPE_ARROW)
before(VALUE_ARGUMENT_LIST).spaces(0)
between(VALUE_ARGUMENT_LIST, LAMBDA_ARGUMENT).spaces(1)
betweenInside(REFERENCE_EXPRESSION, LAMBDA_ARGUMENT, CALL_EXPRESSION).spaces(1)
betweenInside(TYPE_ARGUMENT_LIST, LAMBDA_ARGUMENT, CALL_EXPRESSION).spaces(1)
+3
View File
@@ -0,0 +1,3 @@
fun foo() {
foo()
}
+3
View File
@@ -0,0 +1,3 @@
fun foo() {
foo ()
}
@@ -17,7 +17,7 @@ class C(private val b: A.B) {
A.O.Y()
A.O.foo(A.O.bar)
with (A.O) {
with(A.O) {
A.Companion.Y()
foo(bar)
1.extFoo(1.extBar)
@@ -55,7 +55,7 @@ class A {
O.Y()
O.foo(O.bar)
with (O) {
with(O) {
Y()
foo(bar)
1.extFoo(1.extBar)
@@ -11,7 +11,7 @@ class C {
A.O.Y()
A.O.foo(A.O.bar)
with (A.O) {
with(A.O) {
A.Companion.Y()
foo(bar)
1.extFoo(1.extBar)
@@ -43,7 +43,7 @@ class A {
O.Y()
O.foo(O.bar)
with (O) {
with(O) {
Y()
foo(bar)
1.extFoo(1.extBar)
@@ -11,7 +11,7 @@ class B {
A.O.Y()
A.O.foo(A.O.bar)
with (A.O) {
with(A.O) {
A.Companion.Y()
foo(bar)
1.extFoo(1.extBar)
@@ -42,7 +42,7 @@ class A {
O.Y()
O.foo(O.bar)
with (O) {
with(O) {
Y()
foo(bar)
1.extFoo(1.extBar)
@@ -17,7 +17,7 @@ class B(private val a: A) {
A.O.Y()
A.O.foo(A.O.bar)
with (A.O) {
with(A.O) {
A.Companion.Y()
foo(bar)
1.extFoo(1.extBar)
@@ -54,7 +54,7 @@ class A {
O.Y()
O.foo(O.bar)
with (O) {
with(O) {
Y()
foo(bar)
1.extFoo(1.extBar)
@@ -11,7 +11,7 @@ class B {
A.O.Y()
A.O.foo(A.O.bar)
with (A.O) {
with(A.O) {
A.Companion.Y()
foo(bar)
1.extFoo(1.extBar)
@@ -42,7 +42,7 @@ class A {
O.Y()
O.foo(O.bar)
with (O) {
with(O) {
Y()
foo(bar)
1.extFoo(1.extBar)
@@ -11,7 +11,7 @@ object B {
A.O.Y()
A.O.foo(A.O.bar)
with (A.O) {
with(A.O) {
A.Companion.Y()
foo(bar)
1.extFoo(1.extBar)
@@ -42,7 +42,7 @@ class A {
O.Y()
O.foo(O.bar)
with (O) {
with(O) {
Y()
foo(bar)
1.extFoo(1.extBar)
@@ -379,6 +379,12 @@ public class FormatterTestGenerated extends AbstractFormatterTest {
doTest(fileName);
}
@TestMetadata("MethodCall.after.kt")
public void testMethodCall() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/MethodCall.after.kt");
doTest(fileName);
}
@TestMetadata("Multideclaration.after.kt")
public void testMultideclaration() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/Multideclaration.after.kt");
@@ -1,3 +1,3 @@
synchronized (s) {
synchronized(s) {
doSomething(s)
}