Formatter: handle spaces before value arguments list (KT-12634)
#KT-12634 Fixed
This commit is contained in:
committed by
Nikolay Krasko
parent
922dc85e11
commit
5c68681f96
@@ -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
@@ -0,0 +1,3 @@
|
||||
fun foo() {
|
||||
foo()
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun foo() {
|
||||
foo ()
|
||||
}
|
||||
Vendored
+1
-1
@@ -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)
|
||||
|
||||
Vendored
+1
-1
@@ -55,7 +55,7 @@ class A {
|
||||
O.Y()
|
||||
O.foo(O.bar)
|
||||
|
||||
with (O) {
|
||||
with(O) {
|
||||
Y()
|
||||
foo(bar)
|
||||
1.extFoo(1.extBar)
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
Vendored
+1
-1
@@ -43,7 +43,7 @@ class A {
|
||||
O.Y()
|
||||
O.foo(O.bar)
|
||||
|
||||
with (O) {
|
||||
with(O) {
|
||||
Y()
|
||||
foo(bar)
|
||||
1.extFoo(1.extBar)
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ class A {
|
||||
O.Y()
|
||||
O.foo(O.bar)
|
||||
|
||||
with (O) {
|
||||
with(O) {
|
||||
Y()
|
||||
foo(bar)
|
||||
1.extFoo(1.extBar)
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
Vendored
+1
-1
@@ -54,7 +54,7 @@ class A {
|
||||
O.Y()
|
||||
O.foo(O.bar)
|
||||
|
||||
with (O) {
|
||||
with(O) {
|
||||
Y()
|
||||
foo(bar)
|
||||
1.extFoo(1.extBar)
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ class A {
|
||||
O.Y()
|
||||
O.foo(O.bar)
|
||||
|
||||
with (O) {
|
||||
with(O) {
|
||||
Y()
|
||||
foo(bar)
|
||||
1.extFoo(1.extBar)
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
+1
-1
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user