diff --git a/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/kotlinSpacingRules.kt b/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/kotlinSpacingRules.kt index c0811a82608..14cd79751e3 100644 --- a/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/kotlinSpacingRules.kt +++ b/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/kotlinSpacingRules.kt @@ -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) diff --git a/idea/testData/formatter/MethodCall.after.kt b/idea/testData/formatter/MethodCall.after.kt new file mode 100644 index 00000000000..1175a9653f4 --- /dev/null +++ b/idea/testData/formatter/MethodCall.after.kt @@ -0,0 +1,3 @@ +fun foo() { + foo() +} \ No newline at end of file diff --git a/idea/testData/formatter/MethodCall.kt b/idea/testData/formatter/MethodCall.kt new file mode 100644 index 00000000000..8c83dafa4c2 --- /dev/null +++ b/idea/testData/formatter/MethodCall.kt @@ -0,0 +1,3 @@ +fun foo() { + foo () +} \ No newline at end of file diff --git a/idea/testData/refactoring/move/kotlin/moveNestedClass/deepInnerToTopLevelWithThis/after/C.kt b/idea/testData/refactoring/move/kotlin/moveNestedClass/deepInnerToTopLevelWithThis/after/C.kt index dc74f7e4efa..d99a1ccc3ee 100644 --- a/idea/testData/refactoring/move/kotlin/moveNestedClass/deepInnerToTopLevelWithThis/after/C.kt +++ b/idea/testData/refactoring/move/kotlin/moveNestedClass/deepInnerToTopLevelWithThis/after/C.kt @@ -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) diff --git a/idea/testData/refactoring/move/kotlin/moveNestedClass/deepInnerToTopLevelWithThis/before/test.kt b/idea/testData/refactoring/move/kotlin/moveNestedClass/deepInnerToTopLevelWithThis/before/test.kt index 2e93986b3bd..5c39d956219 100644 --- a/idea/testData/refactoring/move/kotlin/moveNestedClass/deepInnerToTopLevelWithThis/before/test.kt +++ b/idea/testData/refactoring/move/kotlin/moveNestedClass/deepInnerToTopLevelWithThis/before/test.kt @@ -55,7 +55,7 @@ class A { O.Y() O.foo(O.bar) - with (O) { + with(O) { Y() foo(bar) 1.extFoo(1.extBar) diff --git a/idea/testData/refactoring/move/kotlin/moveNestedClass/deepNonInnerToTopLevel/after/C.kt b/idea/testData/refactoring/move/kotlin/moveNestedClass/deepNonInnerToTopLevel/after/C.kt index 383e8aa6e4f..8cbfa7f620e 100644 --- a/idea/testData/refactoring/move/kotlin/moveNestedClass/deepNonInnerToTopLevel/after/C.kt +++ b/idea/testData/refactoring/move/kotlin/moveNestedClass/deepNonInnerToTopLevel/after/C.kt @@ -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) diff --git a/idea/testData/refactoring/move/kotlin/moveNestedClass/deepNonInnerToTopLevel/before/test.kt b/idea/testData/refactoring/move/kotlin/moveNestedClass/deepNonInnerToTopLevel/before/test.kt index ff3802b3c50..1508be3b2b9 100644 --- a/idea/testData/refactoring/move/kotlin/moveNestedClass/deepNonInnerToTopLevel/before/test.kt +++ b/idea/testData/refactoring/move/kotlin/moveNestedClass/deepNonInnerToTopLevel/before/test.kt @@ -43,7 +43,7 @@ class A { O.Y() O.foo(O.bar) - with (O) { + with(O) { Y() foo(bar) 1.extFoo(1.extBar) diff --git a/idea/testData/refactoring/move/kotlin/moveNestedClass/innerToTopLevelNoThis/after/B.kt b/idea/testData/refactoring/move/kotlin/moveNestedClass/innerToTopLevelNoThis/after/B.kt index 71bf44c9638..c9efe67487e 100644 --- a/idea/testData/refactoring/move/kotlin/moveNestedClass/innerToTopLevelNoThis/after/B.kt +++ b/idea/testData/refactoring/move/kotlin/moveNestedClass/innerToTopLevelNoThis/after/B.kt @@ -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) diff --git a/idea/testData/refactoring/move/kotlin/moveNestedClass/innerToTopLevelNoThis/before/test.kt b/idea/testData/refactoring/move/kotlin/moveNestedClass/innerToTopLevelNoThis/before/test.kt index 1076c01f048..7385d5e8b80 100644 --- a/idea/testData/refactoring/move/kotlin/moveNestedClass/innerToTopLevelNoThis/before/test.kt +++ b/idea/testData/refactoring/move/kotlin/moveNestedClass/innerToTopLevelNoThis/before/test.kt @@ -42,7 +42,7 @@ class A { O.Y() O.foo(O.bar) - with (O) { + with(O) { Y() foo(bar) 1.extFoo(1.extBar) diff --git a/idea/testData/refactoring/move/kotlin/moveNestedClass/innerToTopLevelWithThis/after/B.kt b/idea/testData/refactoring/move/kotlin/moveNestedClass/innerToTopLevelWithThis/after/B.kt index b4a5171f6b4..d7f23b5b141 100644 --- a/idea/testData/refactoring/move/kotlin/moveNestedClass/innerToTopLevelWithThis/after/B.kt +++ b/idea/testData/refactoring/move/kotlin/moveNestedClass/innerToTopLevelWithThis/after/B.kt @@ -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) diff --git a/idea/testData/refactoring/move/kotlin/moveNestedClass/innerToTopLevelWithThis/before/test.kt b/idea/testData/refactoring/move/kotlin/moveNestedClass/innerToTopLevelWithThis/before/test.kt index bdc7c96c12b..cf6639ed2fc 100644 --- a/idea/testData/refactoring/move/kotlin/moveNestedClass/innerToTopLevelWithThis/before/test.kt +++ b/idea/testData/refactoring/move/kotlin/moveNestedClass/innerToTopLevelWithThis/before/test.kt @@ -54,7 +54,7 @@ class A { O.Y() O.foo(O.bar) - with (O) { + with(O) { Y() foo(bar) 1.extFoo(1.extBar) diff --git a/idea/testData/refactoring/move/kotlin/moveNestedClass/nonInnerToTopLevel/after/B.kt b/idea/testData/refactoring/move/kotlin/moveNestedClass/nonInnerToTopLevel/after/B.kt index 71bf44c9638..c9efe67487e 100644 --- a/idea/testData/refactoring/move/kotlin/moveNestedClass/nonInnerToTopLevel/after/B.kt +++ b/idea/testData/refactoring/move/kotlin/moveNestedClass/nonInnerToTopLevel/after/B.kt @@ -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) diff --git a/idea/testData/refactoring/move/kotlin/moveNestedClass/nonInnerToTopLevel/before/test.kt b/idea/testData/refactoring/move/kotlin/moveNestedClass/nonInnerToTopLevel/before/test.kt index 0db275c7531..0e5ab620036 100644 --- a/idea/testData/refactoring/move/kotlin/moveNestedClass/nonInnerToTopLevel/before/test.kt +++ b/idea/testData/refactoring/move/kotlin/moveNestedClass/nonInnerToTopLevel/before/test.kt @@ -42,7 +42,7 @@ class A { O.Y() O.foo(O.bar) - with (O) { + with(O) { Y() foo(bar) 1.extFoo(1.extBar) diff --git a/idea/testData/refactoring/move/kotlin/moveNestedClass/objectToTopLevel/after/B.kt b/idea/testData/refactoring/move/kotlin/moveNestedClass/objectToTopLevel/after/B.kt index 7b460f413b3..9da2651370b 100644 --- a/idea/testData/refactoring/move/kotlin/moveNestedClass/objectToTopLevel/after/B.kt +++ b/idea/testData/refactoring/move/kotlin/moveNestedClass/objectToTopLevel/after/B.kt @@ -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) diff --git a/idea/testData/refactoring/move/kotlin/moveNestedClass/objectToTopLevel/before/test.kt b/idea/testData/refactoring/move/kotlin/moveNestedClass/objectToTopLevel/before/test.kt index bdaf2bd5f5e..7821270b6a7 100644 --- a/idea/testData/refactoring/move/kotlin/moveNestedClass/objectToTopLevel/before/test.kt +++ b/idea/testData/refactoring/move/kotlin/moveNestedClass/objectToTopLevel/before/test.kt @@ -42,7 +42,7 @@ class A { O.Y() O.foo(O.bar) - with (O) { + with(O) { Y() foo(bar) 1.extFoo(1.extBar) diff --git a/idea/tests/org/jetbrains/kotlin/formatter/FormatterTestGenerated.java b/idea/tests/org/jetbrains/kotlin/formatter/FormatterTestGenerated.java index 45904f56a00..15b76c7deb6 100644 --- a/idea/tests/org/jetbrains/kotlin/formatter/FormatterTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/formatter/FormatterTestGenerated.java @@ -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"); diff --git a/j2k/testData/fileOrElement/synchronizedStatement/singleLineExample.kt b/j2k/testData/fileOrElement/synchronizedStatement/singleLineExample.kt index f81a9077fb5..7c4df8614b9 100644 --- a/j2k/testData/fileOrElement/synchronizedStatement/singleLineExample.kt +++ b/j2k/testData/fileOrElement/synchronizedStatement/singleLineExample.kt @@ -1,3 +1,3 @@ -synchronized (s) { +synchronized(s) { doSomething(s) } \ No newline at end of file