From c34b417d0c3aff512e8e6d499668c2676b411bef Mon Sep 17 00:00:00 2001 From: Dmitry Gridin Date: Fri, 31 Jan 2020 16:18:13 +0700 Subject: [PATCH] Fix tests after disabling trailing comma #KT-34744 --- .../test/SmartEnterCompletionTest.kt | 6 +- .../testData/anonymous_1.exp.kt | 12 +- .../testData/anonymous_2.exp.kt | 6 +- idea/testData/formatter/ArrayAccess.after.kt | 6 +- idea/testData/formatter/ArrayLiteral.after.kt | 4 +- .../BlankLinesAfterClassHeader.after.kt | 2 +- .../CommentInFunctionLiteral.after.kt | 36 ++-- ...ontinuationIndentInParameterLists.after.kt | 2 +- .../formatter/ElvisIndent.after.inv.kt | 2 +- idea/testData/formatter/ElvisIndent.after.kt | 2 +- .../formatter/EnumInitializerList.after.kt | 2 +- .../ExtendsListAlignEnum.after.inv.kt | 2 +- .../formatter/ExtendsListAlignEnum.after.kt | 2 +- .../FunctionCallParametersAlign.after.kt | 6 +- .../formatter/FunctionExpression.after.kt | 12 +- .../LineBreakBeforeExtendsColon.after.kt | 2 +- .../LineBreakBeforeExtendsColonWrap.after.kt | 2 +- .../formatter/Multideclaration.after.kt | 2 +- .../ParameterAnnotationWrap.after.kt | 6 +- .../formatter/ParameterDocComments.after.kt | 5 +- .../formatter/Parameters.after.inv.kt | 2 +- idea/testData/formatter/Parameters.after.kt | 2 +- .../testData/formatter/WhenEntryExpr.after.kt | 1 + idea/testData/formatter/WhenEntryExpr.kt | 1 + idea/testData/formatter/WhereClause.after.kt | 2 +- .../callChain/CallChainWrapping.after.inv.kt | 13 +- .../callChain/CallChainWrapping.after.kt | 3 +- .../formatter/callChain/CallChainWrapping.kt | 3 +- .../FunctionLiteralsInChainCalls.after.inv.kt | 19 +- .../FunctionLiteralsInChainCalls.after.kt | 1 + .../callChain/FunctionLiteralsInChainCalls.kt | 1 + .../formatter/callChain/KT22148.after.kt | 12 +- .../ArgumentListChopAsNeeded.after.kt | 13 +- .../ArgumentListWrapAlways.after.kt | 16 +- .../ArgumentListWrapAsNeeded.after.kt | 13 +- .../ArgumentListWrapLParen.after.kt | 10 +- .../DefaultParameterValues.after.inv.kt | 4 +- .../DefaultParameterValues.after.kt | 4 +- .../formatter/parameterList/KT19727.after.kt | 31 ++-- .../ParameterListChopAsNeeded.after.kt | 98 +++++----- .../ParameterListWrapAlways.after.kt | 168 +++++++----------- .../ParameterListWrapAsNeeded.after.kt | 95 ++++------ ...inToStringWithReferenceAndComment.kt.after | 3 +- .../callChainWithLineBreak.kt.after | 6 +- .../multipleLines.kt.after | 6 +- .../constantConditionIf/expression.kt.after | 12 +- .../argumentAndFunction.kt.after | 9 +- .../functionalArgument.kt.after | 8 +- .../redundantSamConstructor/simple.kt.after | 8 +- .../exceptionTextHandlesMultiline.kt.after | 6 +- .../withComments.kt.after | 3 +- .../withComposedModifiers.kt.after | 6 +- .../argument.kt.after | 8 +- .../explicitParameterName.kt.after | 8 +- .../extention1.kt.after | 6 +- .../extention2.kt.after | 8 +- .../fullyQualified.kt.after | 8 +- .../fullyQualified_ni.kt.after | 8 +- .../hasComment.kt.after | 12 +- .../hasReturn1.kt.after | 8 +- .../hasReturn2.kt.after | 14 +- .../hasReturn3.kt.after | 20 +-- .../hasReturn4.kt.after | 14 +- .../hasSomeStatements.kt.after | 10 +- .../implicitParameterName.kt.after | 8 +- .../javaMethod.kt.after | 6 +- .../namedArgument.kt.after | 3 +- .../noParameter.kt.after | 8 +- .../returnUnit.kt.after | 10 +- .../withPackage.kt.after | 8 +- .../moveLambda1.kt.after | 8 +- .../moveLambda13.kt.after | 8 +- .../moveLambda14.kt.after | 8 +- .../moveLambda3.kt.after | 10 +- .../moveLambda4.kt.after | 10 +- .../QualifiedReturn.kt.after | 16 +- .../ReturnNoValue.kt.after | 12 +- .../ReturnNotLast.kt.after | 10 +- .../ReturnsInIf.kt.after | 28 ++- .../ReturnsInWhen.kt.after | 22 ++- ...apterNeededBecauseOfLabeledReturn.kt.after | 10 +- .../StatementAndReturn.kt.after | 10 +- .../operatorToFunction/keepComments.kt.after | 6 +- .../nestedClass.kt.after | 10 +- .../keepComments/addArguments.kt.after | 6 +- .../commentBeforeArgument.kt.after | 11 +- .../keepComments/multipleArguments.kt.after | 3 +- .../keepLineBreaks/addArgument.kt.after | 3 +- .../keepLineBreaks/simple.kt.after | 6 +- .../optionalParameterAndLambda.kt.after | 8 +- ...optionalParameterAndLambdaComplex.kt.after | 3 +- .../AddParameterKeepFormatAfter.kt | 12 +- .../MoveLambdaParameterAfter.kt | 10 +- .../NoDefaultValuesInOverridesAfter.kt | 18 +- .../RemoveParameterKeepFormat1After.kt | 6 +- .../RemoveParameterKeepFormat2After.kt | 6 +- .../RemoveParameterKeepFormat3After.kt | 6 +- .../SwapParametersKeepFormatAfter.kt | 12 +- .../returnAtEnd/DefaultParameter.kt.after | 3 +- .../returnAtEnd/ReturnFromLambda.kt.after | 12 +- .../multilineBinaryExpression.kt.after | 10 +- ...ilineBinaryExpressionWithComments.kt.after | 10 +- .../multilineNestedBinaryExpression1.kt.after | 10 +- .../multilineNestedBinaryExpression2.kt.after | 10 +- .../rawTemplateWithSubstring.kt.after | 9 +- .../multilineBinaryExpression.kt.after | 6 +- ...ilineBinaryExpressionWithComments.kt.after | 6 +- .../multilineNestedBinaryExpression1.kt.after | 6 +- .../multilineNestedBinaryExpression2.kt.after | 6 +- .../rawTemplateWithSubstring.kt.after | 7 +- .../InvokeToGetWithQualifiedExpr.kt.after | 6 +- .../InvokeToGetWithSafeQualifiedExpr.kt.after | 6 +- ...nnotationFromConstructorParamToProperty.kt | 6 +- .../annotations/annotationInterface1.kt | 6 +- .../comments/fieldsInitializedFromParams.kt | 3 +- .../lineBreaksBetweenParameters.kt | 22 +-- .../detectProperties/Comments.kt | 3 +- .../DataClassWithAnnotations.kt | 10 +- .../deprecatedDocTagWithMultiLineMessage.kt | 14 +- .../enum/runnableImplementation.kt | 6 +- .../formatting/lineBreaksBetweenArguments.kt | 5 +- .../function/lineBreaksBetweenParameters.kt | 9 +- .../mutableCollections/FunctionParameters.kt | 8 +- .../newClassExpression/lineBreaks.kt | 8 +- .../fileOrElement/objectLiteral/MyFrame.kt | 8 +- .../returnStatement/currentMethodBug.kt | 10 +- .../WithReturnInAnonymousClass.kt | 17 +- .../WithReturnInAnonymousClass2.kt | 17 +- .../annotations/annotationInterface1.kt | 6 +- nj2k/testData/newJ2k/annotations/kt-31726.kt | 3 +- .../comments/fieldsInitializedFromParams.kt | 8 +- .../lineBreaksBetweenParameters.kt | 22 +-- .../newJ2k/detectProperties/Comments.kt | 6 +- .../DataClassWithAnnotations.kt | 8 +- .../deprecatedDocTagWithMultiLineMessage.kt | 6 +- .../newJ2k/enum/runnableImplementation.kt | 6 +- .../formatting/lineBreaksBetweenArguments.kt | 3 +- .../function/lineBreaksBetweenParameters.kt | 9 +- nj2k/testData/newJ2k/issues/kt-19569.kt | 8 +- .../methodCallExpression/stringMethods.kt | 10 +- .../mutableCollections/FunctionParameters.kt | 6 +- .../newJ2k/newClassExpression/lineBreaks.kt | 6 +- nj2k/testData/newJ2k/objectLiteral/MyFrame.kt | 8 +- .../returnStatement/currentMethodBug.kt | 10 +- .../WithReturnInAnonymousClass.kt | 15 +- .../WithReturnInAnonymousClass2.kt | 15 +- 146 files changed, 612 insertions(+), 945 deletions(-) diff --git a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/SmartEnterCompletionTest.kt b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/SmartEnterCompletionTest.kt index d4e34a113c2..cf3c9d022a9 100644 --- a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/SmartEnterCompletionTest.kt +++ b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/SmartEnterCompletionTest.kt @@ -115,10 +115,8 @@ class SmartEnterCompletionTest : KotlinLightCodeInsightFixtureTestCase() { fun foo(p:Int) {} fun test() { - foo( - 1 + - 2 - ) + foo(1 + + 2) } """ ) diff --git a/idea/idea-live-templates/testData/anonymous_1.exp.kt b/idea/idea-live-templates/testData/anonymous_1.exp.kt index d889166c368..2349d4dad4d 100644 --- a/idea/idea-live-templates/testData/anonymous_1.exp.kt +++ b/idea/idea-live-templates/testData/anonymous_1.exp.kt @@ -1,11 +1,9 @@ import javax.swing.SwingUtilities fun main(args : Array) { - SwingUtilities.invokeLater( - object : Runnable { - override fun run() { - TODO("Not yet implemented") - } - } - ) + SwingUtilities.invokeLater(object : Runnable { + override fun run() { + TODO("Not yet implemented") + } + }) } diff --git a/idea/idea-live-templates/testData/anonymous_2.exp.kt b/idea/idea-live-templates/testData/anonymous_2.exp.kt index f5e6efb0dd1..fb49f35e581 100644 --- a/idea/idea-live-templates/testData/anonymous_2.exp.kt +++ b/idea/idea-live-templates/testData/anonymous_2.exp.kt @@ -1,9 +1,7 @@ import javax.swing.SwingUtilities fun main(args : Array) { - SwingUtilities.invokeLater( - object : Thread() { + SwingUtilities.invokeLater(object : Thread() { - } - ) + }) } diff --git a/idea/testData/formatter/ArrayAccess.after.kt b/idea/testData/formatter/ArrayAccess.after.kt index 6cb279cded6..9f74d754037 100644 --- a/idea/testData/formatter/ArrayAccess.after.kt +++ b/idea/testData/formatter/ArrayAccess.after.kt @@ -5,19 +5,19 @@ fun test() { a[1, 2] a[ - 1, 2, + 1, 2 ] a[ - 1, 2, + 1, 2 ] a[ - 1, 2, + 1, 2 ] diff --git a/idea/testData/formatter/ArrayLiteral.after.kt b/idea/testData/formatter/ArrayLiteral.after.kt index 363b3e328ae..18ccaa0af76 100644 --- a/idea/testData/formatter/ArrayLiteral.after.kt +++ b/idea/testData/formatter/ArrayLiteral.after.kt @@ -2,6 +2,6 @@ modules = [ AppModule::class, DataModule::class, - DomainModule::class, - ], + DomainModule::class + ] ) \ No newline at end of file diff --git a/idea/testData/formatter/BlankLinesAfterClassHeader.after.kt b/idea/testData/formatter/BlankLinesAfterClassHeader.after.kt index 8ee4cf38681..d0575c00b7d 100644 --- a/idea/testData/formatter/BlankLinesAfterClassHeader.after.kt +++ b/idea/testData/formatter/BlankLinesAfterClassHeader.after.kt @@ -19,7 +19,7 @@ class FooM } class FooC( - val x: String, + val x: String ) { fun bar() diff --git a/idea/testData/formatter/CommentInFunctionLiteral.after.kt b/idea/testData/formatter/CommentInFunctionLiteral.after.kt index 8dd75bc53a7..a86b5cd16a2 100644 --- a/idea/testData/formatter/CommentInFunctionLiteral.after.kt +++ b/idea/testData/formatter/CommentInFunctionLiteral.after.kt @@ -37,17 +37,13 @@ val s2 = Shadow { // wdwd val a = 42 } -val s3 = Shadow( - fun() { // wdwd - val a = 42 - }, -) +val s3 = Shadow(fun() { // wdwd + val a = 42 +}) -val s4 = Shadow( - fun() { /* s */ - val a = 42 - }, -) +val s4 = Shadow(fun() { /* s */ + val a = 42 +}) val s5 = Shadow { -> // wdwd @@ -59,19 +55,15 @@ val s6 = Shadow { val a = 42 } -val s7 = Shadow( - fun() { - // wdwd - val a = 42 - }, -) +val s7 = Shadow(fun() { + // wdwd + val a = 42 +}) -val s8 = Shadow( - fun() { - // wdwd - val a = 42 - }, -) +val s8 = Shadow(fun() { + // wdwd + val a = 42 +}) val s9 = Shadow { -> /* s */ val a = 42 diff --git a/idea/testData/formatter/ContinuationIndentInParameterLists.after.kt b/idea/testData/formatter/ContinuationIndentInParameterLists.after.kt index d031eb0def1..2c836d4db20 100644 --- a/idea/testData/formatter/ContinuationIndentInParameterLists.after.kt +++ b/idea/testData/formatter/ContinuationIndentInParameterLists.after.kt @@ -1,5 +1,5 @@ fun foo( - x: Int, + x: Int ) { } diff --git a/idea/testData/formatter/ElvisIndent.after.inv.kt b/idea/testData/formatter/ElvisIndent.after.inv.kt index 9548a646720..5c7f185b052 100644 --- a/idea/testData/formatter/ElvisIndent.after.inv.kt +++ b/idea/testData/formatter/ElvisIndent.after.inv.kt @@ -4,7 +4,7 @@ fun foo() { ?: DescriptorUtils.getParentOfType( referencedDescriptor, TypeAliasConstructorDescriptor::class.java, - false, + false )?.typeAliasDescriptor ?: DescriptorUtils.getParentOfType(referencedDescriptor, FunctionDescriptor::class.java, false) ?: return emptyList() diff --git a/idea/testData/formatter/ElvisIndent.after.kt b/idea/testData/formatter/ElvisIndent.after.kt index 8f0ea3ad0ec..eceec5730d8 100644 --- a/idea/testData/formatter/ElvisIndent.after.kt +++ b/idea/testData/formatter/ElvisIndent.after.kt @@ -4,7 +4,7 @@ fun foo() { ?: DescriptorUtils.getParentOfType( referencedDescriptor, TypeAliasConstructorDescriptor::class.java, - false, + false )?.typeAliasDescriptor ?: DescriptorUtils.getParentOfType(referencedDescriptor, FunctionDescriptor::class.java, false) ?: return emptyList() diff --git a/idea/testData/formatter/EnumInitializerList.after.kt b/idea/testData/formatter/EnumInitializerList.after.kt index 62f4d1de4fb..4b626eb6b89 100644 --- a/idea/testData/formatter/EnumInitializerList.after.kt +++ b/idea/testData/formatter/EnumInitializerList.after.kt @@ -3,6 +3,6 @@ package test enum class EnumTest(val value: Int) { VALUE_1 ( - value = 0, + value = 0 ) } \ No newline at end of file diff --git a/idea/testData/formatter/ExtendsListAlignEnum.after.inv.kt b/idea/testData/formatter/ExtendsListAlignEnum.after.inv.kt index 73d54fc6a71..40f31a1ba3c 100644 --- a/idea/testData/formatter/ExtendsListAlignEnum.after.inv.kt +++ b/idea/testData/formatter/ExtendsListAlignEnum.after.inv.kt @@ -2,7 +2,7 @@ enum class EnumTest(val value: Int) { VALUE_1( - value = 0, + value = 0 ) } diff --git a/idea/testData/formatter/ExtendsListAlignEnum.after.kt b/idea/testData/formatter/ExtendsListAlignEnum.after.kt index 73d54fc6a71..40f31a1ba3c 100644 --- a/idea/testData/formatter/ExtendsListAlignEnum.after.kt +++ b/idea/testData/formatter/ExtendsListAlignEnum.after.kt @@ -2,7 +2,7 @@ enum class EnumTest(val value: Int) { VALUE_1( - value = 0, + value = 0 ) } diff --git a/idea/testData/formatter/FunctionCallParametersAlign.after.kt b/idea/testData/formatter/FunctionCallParametersAlign.after.kt index ed561a7e506..9d49208c08c 100644 --- a/idea/testData/formatter/FunctionCallParametersAlign.after.kt +++ b/idea/testData/formatter/FunctionCallParametersAlign.after.kt @@ -1,8 +1,6 @@ fun test() { - someTestLong( - 12, - 13, - ) + someTestLong(12, + 13) } // SET_TRUE: ALIGN_MULTILINE_PARAMETERS_IN_CALLS \ No newline at end of file diff --git a/idea/testData/formatter/FunctionExpression.after.kt b/idea/testData/formatter/FunctionExpression.after.kt index 37dfeb35687..3ee4ddcb10f 100644 --- a/idea/testData/formatter/FunctionExpression.after.kt +++ b/idea/testData/formatter/FunctionExpression.after.kt @@ -13,10 +13,8 @@ val c = fun() = 4 fun test() = fun test() = 4 fun test() { - test( - fun() { - }, - ) + test(fun() { + }) test(fun test() {}) test(fun test() = 5) @@ -30,10 +28,8 @@ fun test() { test(fun test() = 4) } -fun d = fun( - a: Int, - b: String, -) { +fun d = fun(a: Int, + b: String) { } fun e = fun() { diff --git a/idea/testData/formatter/LineBreakBeforeExtendsColon.after.kt b/idea/testData/formatter/LineBreakBeforeExtendsColon.after.kt index f8a331b0057..e1724d793ba 100644 --- a/idea/testData/formatter/LineBreakBeforeExtendsColon.after.kt +++ b/idea/testData/formatter/LineBreakBeforeExtendsColon.after.kt @@ -1,4 +1,4 @@ open class GFMOutputBuilder( - to: StringBuilder, + to: StringBuilder ) : MarkdownOutputBuilder(to) { } diff --git a/idea/testData/formatter/LineBreakBeforeExtendsColonWrap.after.kt b/idea/testData/formatter/LineBreakBeforeExtendsColonWrap.after.kt index aa3d159d354..d119bee2087 100644 --- a/idea/testData/formatter/LineBreakBeforeExtendsColonWrap.after.kt +++ b/idea/testData/formatter/LineBreakBeforeExtendsColonWrap.after.kt @@ -1,5 +1,5 @@ open class GFMOutputBuilder( - to: StringBuilder, + to: StringBuilder ) : MarkdownOutputBuilder(to) { } diff --git a/idea/testData/formatter/Multideclaration.after.kt b/idea/testData/formatter/Multideclaration.after.kt index 7d5757ddd3d..d2bbf5afaff 100644 --- a/idea/testData/formatter/Multideclaration.after.kt +++ b/idea/testData/formatter/Multideclaration.after.kt @@ -10,6 +10,6 @@ fun test() { items, shippingMethods, addresses, - preferredAddressId, + preferredAddressId ) = argument } \ No newline at end of file diff --git a/idea/testData/formatter/ParameterAnnotationWrap.after.kt b/idea/testData/formatter/ParameterAnnotationWrap.after.kt index 894ff2a56b1..52c559b9c48 100644 --- a/idea/testData/formatter/ParameterAnnotationWrap.after.kt +++ b/idea/testData/formatter/ParameterAnnotationWrap.after.kt @@ -1,9 +1,7 @@ -fun foo( - @Deprecated("x") +fun foo(@Deprecated("x") x: Int, @Deprecated("y") @Deprecated("z") - y: Int, -) + y: Int) // SET_INT: PARAMETER_ANNOTATION_WRAP = 2 diff --git a/idea/testData/formatter/ParameterDocComments.after.kt b/idea/testData/formatter/ParameterDocComments.after.kt index 721503964ca..05b7fce125f 100644 --- a/idea/testData/formatter/ParameterDocComments.after.kt +++ b/idea/testData/formatter/ParameterDocComments.after.kt @@ -8,8 +8,7 @@ class A( /** * Doc */ - val p2: String, -) + val p2: String) class B( /** Doc1 */ @@ -18,5 +17,5 @@ class B( /** * Doc2 */ - val v2: Int, + val v2: Int ) \ No newline at end of file diff --git a/idea/testData/formatter/Parameters.after.inv.kt b/idea/testData/formatter/Parameters.after.inv.kt index fb03e1cfcc5..276b8d36e73 100644 --- a/idea/testData/formatter/Parameters.after.inv.kt +++ b/idea/testData/formatter/Parameters.after.inv.kt @@ -1,7 +1,7 @@ fun some( a :Int, b :String, c :Int, - d :String, e :Int, + d :String, e :Int ) { } diff --git a/idea/testData/formatter/Parameters.after.kt b/idea/testData/formatter/Parameters.after.kt index 4d5a3305e38..7d801a1931e 100644 --- a/idea/testData/formatter/Parameters.after.kt +++ b/idea/testData/formatter/Parameters.after.kt @@ -1,7 +1,7 @@ fun some( a: Int, b: String, c: Int, - d: String, e: Int, + d: String, e: Int ) { } diff --git a/idea/testData/formatter/WhenEntryExpr.after.kt b/idea/testData/formatter/WhenEntryExpr.after.kt index 4444782c4f3..deab5bf7c72 100644 --- a/idea/testData/formatter/WhenEntryExpr.after.kt +++ b/idea/testData/formatter/WhenEntryExpr.after.kt @@ -58,3 +58,4 @@ fun some(x: Any) { } } } +// SET_TRUE: ALLOW_TRAILING_COMMA \ No newline at end of file diff --git a/idea/testData/formatter/WhenEntryExpr.kt b/idea/testData/formatter/WhenEntryExpr.kt index 55010a37421..19efa12fd5a 100644 --- a/idea/testData/formatter/WhenEntryExpr.kt +++ b/idea/testData/formatter/WhenEntryExpr.kt @@ -66,3 +66,4 @@ else } } } +// SET_TRUE: ALLOW_TRAILING_COMMA \ No newline at end of file diff --git a/idea/testData/formatter/WhereClause.after.kt b/idea/testData/formatter/WhereClause.after.kt index 58606cdfe68..61fafbbbbf0 100644 --- a/idea/testData/formatter/WhereClause.after.kt +++ b/idea/testData/formatter/WhereClause.after.kt @@ -1,6 +1,6 @@ abstract class RustNavigationContributorBase protected constructor( private val indexKey: StubIndexKey, - private val clazz: Class, + private val clazz: Class ) : ChooseByNameContributor, GotoClassContributor where T : NavigationItem, T : RustNamedElement { diff --git a/idea/testData/formatter/callChain/CallChainWrapping.after.inv.kt b/idea/testData/formatter/callChain/CallChainWrapping.after.inv.kt index 24bbdebb68a..349fcdb896a 100644 --- a/idea/testData/formatter/callChain/CallChainWrapping.after.inv.kt +++ b/idea/testData/formatter/callChain/CallChainWrapping.after.inv.kt @@ -41,12 +41,10 @@ val x8 = foo!!!!!!!! val x9 = ((b!!)!!!!)!! .f -val y = xyzzy( - foo - .bar() - .baz() - .quux(), -) +val y = xyzzy(foo + .bar() + .baz() + .quux()) fun foo() { foo @@ -91,4 +89,5 @@ fun foo() { } // SET_INT: METHOD_CALL_CHAIN_WRAP = 2 -// SET_FALSE: WRAP_FIRST_METHOD_IN_CALL_CHAIN \ No newline at end of file +// SET_FALSE: WRAP_FIRST_METHOD_IN_CALL_CHAIN +// SET_TRUE: ALLOW_TRAILING_COMMA \ No newline at end of file diff --git a/idea/testData/formatter/callChain/CallChainWrapping.after.kt b/idea/testData/formatter/callChain/CallChainWrapping.after.kt index bb2676463e6..72aee707411 100644 --- a/idea/testData/formatter/callChain/CallChainWrapping.after.kt +++ b/idea/testData/formatter/callChain/CallChainWrapping.after.kt @@ -71,4 +71,5 @@ fun foo() { } // SET_INT: METHOD_CALL_CHAIN_WRAP = 2 -// SET_FALSE: WRAP_FIRST_METHOD_IN_CALL_CHAIN \ No newline at end of file +// SET_FALSE: WRAP_FIRST_METHOD_IN_CALL_CHAIN +// SET_TRUE: ALLOW_TRAILING_COMMA diff --git a/idea/testData/formatter/callChain/CallChainWrapping.kt b/idea/testData/formatter/callChain/CallChainWrapping.kt index 98489357454..a1be4d1ef14 100644 --- a/idea/testData/formatter/callChain/CallChainWrapping.kt +++ b/idea/testData/formatter/callChain/CallChainWrapping.kt @@ -38,4 +38,5 @@ fun foo() { } // SET_INT: METHOD_CALL_CHAIN_WRAP = 2 -// SET_FALSE: WRAP_FIRST_METHOD_IN_CALL_CHAIN \ No newline at end of file +// SET_FALSE: WRAP_FIRST_METHOD_IN_CALL_CHAIN +// SET_TRUE: ALLOW_TRAILING_COMMA diff --git a/idea/testData/formatter/callChain/FunctionLiteralsInChainCalls.after.inv.kt b/idea/testData/formatter/callChain/FunctionLiteralsInChainCalls.after.inv.kt index fbf91d499f5..1a2fca92a4d 100644 --- a/idea/testData/formatter/callChain/FunctionLiteralsInChainCalls.after.inv.kt +++ b/idea/testData/formatter/callChain/FunctionLiteralsInChainCalls.after.inv.kt @@ -12,16 +12,12 @@ fun test() { fun test1() { val abc = ArrayList() - .map( - { - it * 2 - }, - ) - .filter( - { - it > 4 - }, - ) + .map({ + it * 2 + }) + .filter({ + it > 4 + }) } fun test2() { @@ -39,7 +35,7 @@ fun test3() { fun test4() { val abc = ArrayList().mapTo( - LinkedHashSet(), + LinkedHashSet() ) { it * 2 } @@ -56,3 +52,4 @@ fun testWithComments() { } // SET_TRUE: CONTINUATION_INDENT_FOR_CHAINED_CALLS +// SET_TRUE: ALLOW_TRAILING_COMMA \ No newline at end of file diff --git a/idea/testData/formatter/callChain/FunctionLiteralsInChainCalls.after.kt b/idea/testData/formatter/callChain/FunctionLiteralsInChainCalls.after.kt index cd977ff3bfe..bf2018018d5 100644 --- a/idea/testData/formatter/callChain/FunctionLiteralsInChainCalls.after.kt +++ b/idea/testData/formatter/callChain/FunctionLiteralsInChainCalls.after.kt @@ -56,3 +56,4 @@ fun testWithComments() { } // SET_TRUE: CONTINUATION_INDENT_FOR_CHAINED_CALLS +// SET_TRUE: ALLOW_TRAILING_COMMA \ No newline at end of file diff --git a/idea/testData/formatter/callChain/FunctionLiteralsInChainCalls.kt b/idea/testData/formatter/callChain/FunctionLiteralsInChainCalls.kt index 1f7f5f9aafc..0531e19cb26 100644 --- a/idea/testData/formatter/callChain/FunctionLiteralsInChainCalls.kt +++ b/idea/testData/formatter/callChain/FunctionLiteralsInChainCalls.kt @@ -52,3 +52,4 @@ fun testWithComments() { } // SET_TRUE: CONTINUATION_INDENT_FOR_CHAINED_CALLS +// SET_TRUE: ALLOW_TRAILING_COMMA \ No newline at end of file diff --git a/idea/testData/formatter/callChain/KT22148.after.kt b/idea/testData/formatter/callChain/KT22148.after.kt index 9d5412bb768..d582ebcedba 100644 --- a/idea/testData/formatter/callChain/KT22148.after.kt +++ b/idea/testData/formatter/callChain/KT22148.after.kt @@ -6,11 +6,9 @@ fun foo() { finish() } - FirebaseAuth.getInstance().addAuthStateListener( - object : FirebaseAuth.AuthStateListener { - override fun onAuthStateChanged(auth: FirebaseAuth) { - // ... - } - }, - ) + FirebaseAuth.getInstance().addAuthStateListener(object : FirebaseAuth.AuthStateListener { + override fun onAuthStateChanged(auth: FirebaseAuth) { + // ... + } + }) } diff --git a/idea/testData/formatter/parameterList/ArgumentListChopAsNeeded.after.kt b/idea/testData/formatter/parameterList/ArgumentListChopAsNeeded.after.kt index 352bcb4236d..57213a05f53 100644 --- a/idea/testData/formatter/parameterList/ArgumentListChopAsNeeded.after.kt +++ b/idea/testData/formatter/parameterList/ArgumentListChopAsNeeded.after.kt @@ -10,15 +10,12 @@ fun foo() { testtest(foofoo) testtesttesttest( - foofoofoofoofoofoofoofoofoofoofoofoo, - ) + foofoofoofoofoofoofoofoofoofoofoofoo) testtest(foobar, barfoo) - testtesttesttest( - foofoo, - barbar, - foobar, - barfoo, - ) + testtesttesttest(foofoo, + barbar, + foobar, + barfoo) } \ No newline at end of file diff --git a/idea/testData/formatter/parameterList/ArgumentListWrapAlways.after.kt b/idea/testData/formatter/parameterList/ArgumentListWrapAlways.after.kt index fb7f5c3cee5..5d5a1d8d0c2 100644 --- a/idea/testData/formatter/parameterList/ArgumentListWrapAlways.after.kt +++ b/idea/testData/formatter/parameterList/ArgumentListWrapAlways.after.kt @@ -11,15 +11,11 @@ fun foo() { testtesttesttest(foofoofoofoofoofoofoofoofoofoofoofoo) - testtest( - foobar, - barfoo, - ) + testtest(foobar, + barfoo) - testtesttesttest( - foofoo, - barbar, - foobar, - barfoo, - ) + testtesttesttest(foofoo, + barbar, + foobar, + barfoo) } \ No newline at end of file diff --git a/idea/testData/formatter/parameterList/ArgumentListWrapAsNeeded.after.kt b/idea/testData/formatter/parameterList/ArgumentListWrapAsNeeded.after.kt index c4cbca089d8..41dbfd09778 100644 --- a/idea/testData/formatter/parameterList/ArgumentListWrapAsNeeded.after.kt +++ b/idea/testData/formatter/parameterList/ArgumentListWrapAsNeeded.after.kt @@ -10,15 +10,12 @@ fun foo() { testtest(foofoo) testtesttesttest( - foofoofoofoofoofoofoofoofoofoofoofoo, - ) + foofoofoofoofoofoofoofoofoofoofoofoo) testtest(foobar, barfoo) - testtesttesttest( - foofoo, - barbar, - foobar, - barfoo, - ) + testtesttesttest(foofoo, + barbar, + foobar, + barfoo) } \ No newline at end of file diff --git a/idea/testData/formatter/parameterList/ArgumentListWrapLParen.after.kt b/idea/testData/formatter/parameterList/ArgumentListWrapLParen.after.kt index d678249a11a..2b60cd24df6 100644 --- a/idea/testData/formatter/parameterList/ArgumentListWrapLParen.after.kt +++ b/idea/testData/formatter/parameterList/ArgumentListWrapLParen.after.kt @@ -4,10 +4,8 @@ fun foo() { foo(bar, baz) - foo( - object : Quux { - override fun foo() { - } - }, - ) + foo(object : Quux { + override fun foo() { + } + }) } diff --git a/idea/testData/formatter/parameterList/DefaultParameterValues.after.inv.kt b/idea/testData/formatter/parameterList/DefaultParameterValues.after.inv.kt index bc0813527c7..f91e65f4fb9 100644 --- a/idea/testData/formatter/parameterList/DefaultParameterValues.after.inv.kt +++ b/idea/testData/formatter/parameterList/DefaultParameterValues.after.inv.kt @@ -1,12 +1,12 @@ fun foo( x: Int = - 42, + 42 ) { } class C( val x: Int = - 42, + 42 ) // SET_TRUE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES diff --git a/idea/testData/formatter/parameterList/DefaultParameterValues.after.kt b/idea/testData/formatter/parameterList/DefaultParameterValues.after.kt index d1b0a9acf49..0c5e97ef42d 100644 --- a/idea/testData/formatter/parameterList/DefaultParameterValues.after.kt +++ b/idea/testData/formatter/parameterList/DefaultParameterValues.after.kt @@ -1,12 +1,12 @@ fun foo( x: Int = - 42, + 42 ) { } class C( val x: Int = - 42, + 42 ) // SET_TRUE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES diff --git a/idea/testData/formatter/parameterList/KT19727.after.kt b/idea/testData/formatter/parameterList/KT19727.after.kt index 3ca1301f82b..0b19e2465af 100644 --- a/idea/testData/formatter/parameterList/KT19727.after.kt +++ b/idea/testData/formatter/parameterList/KT19727.after.kt @@ -5,28 +5,19 @@ fun useCallable(tag: String, callable: Callable<*>) { fun main(args: Array) { useCallable("A", Callable { println("Hello world") }) - useCallable( - "B", - Callable { - println("Hello world") - }, - ) + useCallable("B", Callable { + println("Hello world") + }) - useCallable( - "C", - object : Callable { - override fun call() { - println("Hello world") - } - }, - ) + useCallable("C", object : Callable { + override fun call() { + println("Hello world") + } + }) - useCallable( - "B", - fun() { - println("Hello world") - }, - ) + useCallable("B", fun() { + println("Hello world") + }) } // SET_TRUE: CALL_PARAMETERS_LPAREN_ON_NEXT_LINE diff --git a/idea/testData/formatter/parameterList/ParameterListChopAsNeeded.after.kt b/idea/testData/formatter/parameterList/ParameterListChopAsNeeded.after.kt index ef42cb1456a..cae295a237e 100644 --- a/idea/testData/formatter/parameterList/ParameterListChopAsNeeded.after.kt +++ b/idea/testData/formatter/parameterList/ParameterListChopAsNeeded.after.kt @@ -12,12 +12,10 @@ fun testtesttesttest(foofoo: Int) fun test(foo: Int, bar: Int) -fun testtesttesttest( - foofoo: Int, - barbar: Int, - foobar: Int, - barfoo: Int, -) +fun testtesttesttest(foofoo: Int, + barbar: Int, + foobar: Int, + barfoo: Int) fun test() { for (foo: Int in bar) { @@ -41,34 +39,26 @@ class LongLongLongLongNameCLass class ShorName class SN -class A( - longLongLongLongNameCLass1: LongLongLongLongNameCLass, +class A(longLongLongLongNameCLass1: LongLongLongLongNameCLass, longLongLongLongNameCLass2: LongLongLongLongNameCLass, - longLongLongLongNameCLass3: LongLongLongLongNameCLass, -) { + longLongLongLongNameCLass3: LongLongLongLongNameCLass) { constructor( longLongLongLongNameCLass1: LongLongLongLongNameCLass, longLongLongLongNameCLass2: LongLongLongLongNameCLass, - longLongLongLongNameCLass3: LongLongLongLongNameCLass, - ) { + longLongLongLongNameCLass3: LongLongLongLongNameCLass) { } } -class B( - a: LongLongLongLongNameCLass, +class B(a: LongLongLongLongNameCLass, b: LongLongLongLongNameCLass, - c: LongLongLongLongNameCLass, -) { - constructor( - a: LongLongLongLongNameCLass, - b: LongLongLongLongNameCLass, - c: LongLongLongLongNameCLass, - ) { + c: LongLongLongLongNameCLass) { + constructor(a: LongLongLongLongNameCLass, + b: LongLongLongLongNameCLass, + c: LongLongLongLongNameCLass) { } } -class C( - sn1: ShorName, +class C(sn1: ShorName, sn2: ShorName, sn3: ShorName, sn4: ShorName, @@ -76,24 +66,20 @@ class C( sn6: ShorName, sn6: ShorName, sn8: ShorName, - sn9: ShorName, -) { - constructor( - sn1: ShorName, - sn2: ShorName, - sn3: ShorName, - sn4: ShorName, - sn5: ShorName, - sn6: ShorName, - sn6: ShorName, - sn8: ShorName, - sn9: ShorName, - ) { + sn9: ShorName) { + constructor(sn1: ShorName, + sn2: ShorName, + sn3: ShorName, + sn4: ShorName, + sn5: ShorName, + sn6: ShorName, + sn6: ShorName, + sn8: ShorName, + sn9: ShorName) { } } -class D( - sn1: SN, +class D(sn1: SN, sn2: SN, sn3: SN, sn4: SN, @@ -106,31 +92,27 @@ class D( sn11: SN, sn12: SN, sn13: SN, - sn14: SN, -) { - constructor( - sn1: SN, - sn2: SN, - sn3: SN, - sn4: SN, - sn5: SN, - sn6: SN, - sn6: SN, - sn8: SN, - sn9: SN, - sn10: SN, - sn11: SN, - sn12: SN, - sn13: SN, - sn14: SN, - ) { + sn14: SN) { + constructor(sn1: SN, + sn2: SN, + sn3: SN, + sn4: SN, + sn5: SN, + sn6: SN, + sn6: SN, + sn8: SN, + sn9: SN, + sn10: SN, + sn11: SN, + sn12: SN, + sn13: SN, + sn14: SN) { } } class E(longLongLongLongNameCLass1: LongLongLongLongNameCLass) { constructor( - longLongLongLongNameCLass1: LongLongLongLongNameCLass, - ) { + longLongLongLongNameCLass1: LongLongLongLongNameCLass) { } } diff --git a/idea/testData/formatter/parameterList/ParameterListWrapAlways.after.kt b/idea/testData/formatter/parameterList/ParameterListWrapAlways.after.kt index c8e7cdc278a..270799b10df 100644 --- a/idea/testData/formatter/parameterList/ParameterListWrapAlways.after.kt +++ b/idea/testData/formatter/parameterList/ParameterListWrapAlways.after.kt @@ -10,31 +10,23 @@ fun testtest(foofoo: Int) fun testtesttesttest(foofoo: Int) -fun test( - foo: Int, - bar: Int, -) +fun test(foo: Int, + bar: Int) -fun testtesttesttest( - foofoo: Int, - barbar: Int, - foobar: Int, - barfoo: Int, -) +fun testtesttesttest(foofoo: Int, + barbar: Int, + foobar: Int, + barfoo: Int) -fun testtesttesttest( - foofoo: Int, - @Some barbar: Int, - foobar: Int, - barfoo: Int, -) +fun testtesttesttest(foofoo: Int, + @Some barbar: Int, + foobar: Int, + barfoo: Int) -fun testtesttesttest( - @Some foofoo: Int, - @Some barbar: Int, - @Some foobar: Int, - barfoo: Int, -) +fun testtesttesttest(@Some foofoo: Int, + @Some barbar: Int, + @Some foobar: Int, + barfoo: Int) fun test() { for (foo: Int in bar) { @@ -58,34 +50,25 @@ class LongLongLongLongNameCLass class ShorName class SN -class A( - longLongLongLongNameCLass1: LongLongLongLongNameCLass, +class A(longLongLongLongNameCLass1: LongLongLongLongNameCLass, longLongLongLongNameCLass2: LongLongLongLongNameCLass, - longLongLongLongNameCLass3: LongLongLongLongNameCLass, -) { - constructor( - longLongLongLongNameCLass1: LongLongLongLongNameCLass, - longLongLongLongNameCLass2: LongLongLongLongNameCLass, - longLongLongLongNameCLass3: LongLongLongLongNameCLass, - ) { + longLongLongLongNameCLass3: LongLongLongLongNameCLass) { + constructor(longLongLongLongNameCLass1: LongLongLongLongNameCLass, + longLongLongLongNameCLass2: LongLongLongLongNameCLass, + longLongLongLongNameCLass3: LongLongLongLongNameCLass) { } } -class B( - a: LongLongLongLongNameCLass, +class B(a: LongLongLongLongNameCLass, b: LongLongLongLongNameCLass, - c: LongLongLongLongNameCLass, -) { - constructor( - a: LongLongLongLongNameCLass, - b: LongLongLongLongNameCLass, - c: LongLongLongLongNameCLass, - ) { + c: LongLongLongLongNameCLass) { + constructor(a: LongLongLongLongNameCLass, + b: LongLongLongLongNameCLass, + c: LongLongLongLongNameCLass) { } } -class C( - sn1: ShorName, +class C(sn1: ShorName, sn2: ShorName, sn3: ShorName, sn4: ShorName, @@ -93,24 +76,20 @@ class C( sn6: ShorName, sn6: ShorName, sn8: ShorName, - sn9: ShorName, -) { - constructor( - sn1: ShorName, - sn2: ShorName, - sn3: ShorName, - sn4: ShorName, - sn5: ShorName, - sn6: ShorName, - sn6: ShorName, - sn8: ShorName, - sn9: ShorName, - ) { + sn9: ShorName) { + constructor(sn1: ShorName, + sn2: ShorName, + sn3: ShorName, + sn4: ShorName, + sn5: ShorName, + sn6: ShorName, + sn6: ShorName, + sn8: ShorName, + sn9: ShorName) { } } -class D( - sn1: SN, +class D(sn1: SN, sn2: SN, sn3: SN, sn4: SN, @@ -123,24 +102,21 @@ class D( sn11: SN, sn12: SN, sn13: SN, - sn14: SN, -) { - constructor( - sn1: SN, - sn2: SN, - sn3: SN, - sn4: SN, - sn5: SN, - sn6: SN, - sn6: SN, - sn8: SN, - sn9: SN, - sn10: SN, - sn11: SN, - sn12: SN, - sn13: SN, - sn14: SN, - ) { + sn14: SN) { + constructor(sn1: SN, + sn2: SN, + sn3: SN, + sn4: SN, + sn5: SN, + sn6: SN, + sn6: SN, + sn8: SN, + sn9: SN, + sn10: SN, + sn11: SN, + sn12: SN, + sn13: SN, + sn14: SN) { } } @@ -159,16 +135,13 @@ class G(sn1: ShorName) { } } -class H( - sn1: SN, - sn2: SN, -) { +class H(sn1: SN, + sn2: SN) { constructor(sn1: SN) { } } -class I( - sn1: SN, +class I(sn1: SN, @field:Some val sn2: SN, sn3: SN, sn4: SN, @@ -181,23 +154,20 @@ class I( sn11: SN, sn12: SN, sn13: SN, - sn14: SN, -) { - constructor( - sn1: SN, - sn2: SN, - sn3: SN, - @Some sn4: SN, - sn5: SN, - sn6: SN, - sn6: SN, - sn8: SN, - sn9: SN, - sn10: SN, - sn11: SN, - sn12: SN, - sn13: SN, - sn14: SN, - ) { + sn14: SN) { + constructor(sn1: SN, + sn2: SN, + sn3: SN, + @Some sn4: SN, + sn5: SN, + sn6: SN, + sn6: SN, + sn8: SN, + sn9: SN, + sn10: SN, + sn11: SN, + sn12: SN, + sn13: SN, + sn14: SN) { } } diff --git a/idea/testData/formatter/parameterList/ParameterListWrapAsNeeded.after.kt b/idea/testData/formatter/parameterList/ParameterListWrapAsNeeded.after.kt index d9720e2dad2..c119f6f61cd 100644 --- a/idea/testData/formatter/parameterList/ParameterListWrapAsNeeded.after.kt +++ b/idea/testData/formatter/parameterList/ParameterListWrapAsNeeded.after.kt @@ -9,8 +9,7 @@ fun testtesttesttesttesttesttesttesttest() fun testtest(foofoo: Int) fun testtesttesttest( - foofoo: Int, -) + foofoo: Int) fun test(foo: Int, bar: Int) @@ -18,8 +17,7 @@ fun testtesttesttest( foofoo: Int, barbar: Int, foobar: Int, - barfoo: Int, -) + barfoo: Int) fun test() { for (foo: Int in bar) { @@ -43,34 +41,27 @@ class LongLongLongLongNameCLass class ShorName class SN -class A( - longLongLongLongNameCLass1: LongLongLongLongNameCLass, +class A(longLongLongLongNameCLass1: LongLongLongLongNameCLass, longLongLongLongNameCLass2: LongLongLongLongNameCLass, - longLongLongLongNameCLass3: LongLongLongLongNameCLass, -) { + longLongLongLongNameCLass3: LongLongLongLongNameCLass) { constructor( longLongLongLongNameCLass1: LongLongLongLongNameCLass, longLongLongLongNameCLass2: LongLongLongLongNameCLass, - longLongLongLongNameCLass3: LongLongLongLongNameCLass, - ) { + longLongLongLongNameCLass3: LongLongLongLongNameCLass) { } } -class B( - a: LongLongLongLongNameCLass, +class B(a: LongLongLongLongNameCLass, b: LongLongLongLongNameCLass, - c: LongLongLongLongNameCLass, -) { + c: LongLongLongLongNameCLass) { constructor( a: LongLongLongLongNameCLass, b: LongLongLongLongNameCLass, - c: LongLongLongLongNameCLass, - ) { + c: LongLongLongLongNameCLass) { } } -class C( - sn1: ShorName, +class C(sn1: ShorName, sn2: ShorName, sn3: ShorName, sn4: ShorName, @@ -78,68 +69,58 @@ class C( sn6: ShorName, sn6: ShorName, sn8: ShorName, - sn9: ShorName, -) { - constructor( - sn1: ShorName, - sn2: ShorName, - sn3: ShorName, - sn4: ShorName, - sn5: ShorName, - sn6: ShorName, - sn6: ShorName, - sn8: ShorName, - sn9: ShorName, - ) { + sn9: ShorName) { + constructor(sn1: ShorName, + sn2: ShorName, + sn3: ShorName, + sn4: ShorName, + sn5: ShorName, + sn6: ShorName, + sn6: ShorName, + sn8: ShorName, + sn9: ShorName) { } } -class D( - sn1: SN, sn2: SN, +class D(sn1: SN, sn2: SN, sn3: SN, sn4: SN, sn5: SN, sn6: SN, sn6: SN, sn8: SN, sn9: SN, sn10: SN, sn11: SN, sn12: SN, - sn13: SN, sn14: SN, -) { - constructor( - sn1: SN, - sn2: SN, - sn3: SN, - sn4: SN, - sn5: SN, - sn6: SN, - sn6: SN, - sn8: SN, - sn9: SN, - sn10: SN, - sn11: SN, - sn12: SN, - sn13: SN, - sn14: SN, - ) { + sn13: SN, sn14: SN) { + constructor(sn1: SN, + sn2: SN, + sn3: SN, + sn4: SN, + sn5: SN, + sn6: SN, + sn6: SN, + sn8: SN, + sn9: SN, + sn10: SN, + sn11: SN, + sn12: SN, + sn13: SN, + sn14: SN) { } } class E(longLongLongLongNameCLass1: LongLongLongLongNameCLass) { constructor( - longLongLongLongNameCLass1: LongLongLongLongNameCLass, - ) { + longLongLongLongNameCLass1: LongLongLongLongNameCLass) { } } class F(a: LongLongLongLongNameCLass) { constructor( - a: LongLongLongLongNameCLass, - ) { + a: LongLongLongLongNameCLass) { } } class G(sn1: ShorName) { constructor( - sn1: ShorName, - ) { + sn1: ShorName) { } } diff --git a/idea/testData/inspectionsLocal/collections/simplifiableCallChain/joinToStringWithReferenceAndComment.kt.after b/idea/testData/inspectionsLocal/collections/simplifiableCallChain/joinToStringWithReferenceAndComment.kt.after index a3a06c19490..c0127ebc9f3 100644 --- a/idea/testData/inspectionsLocal/collections/simplifiableCallChain/joinToStringWithReferenceAndComment.kt.after +++ b/idea/testData/inspectionsLocal/collections/simplifiableCallChain/joinToStringWithReferenceAndComment.kt.after @@ -4,8 +4,9 @@ val x = listOf(1, 2, 3).joinToString( // comment2 prefix = "= ", // comment3 - separator = " + ", + separator = " + " // comment4 + , // comment1 transform = Int::toString ) \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/complexRedundantLet/callChainWithLineBreak.kt.after b/idea/testData/inspectionsLocal/complexRedundantLet/callChainWithLineBreak.kt.after index 58bc1699d4f..deb1d311d36 100644 --- a/idea/testData/inspectionsLocal/complexRedundantLet/callChainWithLineBreak.kt.after +++ b/idea/testData/inspectionsLocal/complexRedundantLet/callChainWithLineBreak.kt.after @@ -2,8 +2,6 @@ // HIGHLIGHT: INFORMATION fun test(list: List) { - println( - list.filter { it > 1 } - .filter { it > 2 } - ) + println(list.filter { it > 1 } + .filter { it > 2 }) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/complexRedundantLet/multipleLines.kt.after b/idea/testData/inspectionsLocal/complexRedundantLet/multipleLines.kt.after index a7c2d18702e..f709f269822 100644 --- a/idea/testData/inspectionsLocal/complexRedundantLet/multipleLines.kt.after +++ b/idea/testData/inspectionsLocal/complexRedundantLet/multipleLines.kt.after @@ -2,9 +2,7 @@ // HIGHLIGHT: INFORMATION fun test() { - println( - runCatching { + println(runCatching { /* lots of code*/ - } - ) + }) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/constantConditionIf/expression.kt.after b/idea/testData/inspectionsLocal/constantConditionIf/expression.kt.after index 3b68ed8e02d..c0e4ab06db7 100644 --- a/idea/testData/inspectionsLocal/constantConditionIf/expression.kt.after +++ b/idea/testData/inspectionsLocal/constantConditionIf/expression.kt.after @@ -3,11 +3,9 @@ fun foo(x: Int) {} fun bar() { - foo( - run { - foo(1) - foo(2) - 1 - } - ) + foo(run { + foo(1) + foo(2) + 1 + }) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/conventionNameCalls/replaceGetOrSet/argumentAndFunction.kt.after b/idea/testData/inspectionsLocal/conventionNameCalls/replaceGetOrSet/argumentAndFunction.kt.after index 9e7554158e5..8622c1c606e 100644 --- a/idea/testData/inspectionsLocal/conventionNameCalls/replaceGetOrSet/argumentAndFunction.kt.after +++ b/idea/testData/inspectionsLocal/conventionNameCalls/replaceGetOrSet/argumentAndFunction.kt.after @@ -3,12 +3,9 @@ fun test() { operator fun get(a: Int, b: Int, fn: (i: Int) -> Int) : Int = 0 } val test = Test() - test[ - 1, 2, - { i -> - i - } - ] + test[1, 2, { i -> + i + }] } fun withSuppression() { diff --git a/idea/testData/inspectionsLocal/conventionNameCalls/replaceGetOrSet/functionalArgument.kt.after b/idea/testData/inspectionsLocal/conventionNameCalls/replaceGetOrSet/functionalArgument.kt.after index 1e56793eda5..e714c132780 100644 --- a/idea/testData/inspectionsLocal/conventionNameCalls/replaceGetOrSet/functionalArgument.kt.after +++ b/idea/testData/inspectionsLocal/conventionNameCalls/replaceGetOrSet/functionalArgument.kt.after @@ -3,9 +3,7 @@ fun test() { operator fun get(fn: (i: Int) -> Int) : Int = 0 } val test = Test() - test[ - { i -> - i - } - ] + test[{ i -> + i + }] } diff --git a/idea/testData/inspectionsLocal/redundantSamConstructor/simple.kt.after b/idea/testData/inspectionsLocal/redundantSamConstructor/simple.kt.after index c161c1a5074..cb36a0a8b58 100644 --- a/idea/testData/inspectionsLocal/redundantSamConstructor/simple.kt.after +++ b/idea/testData/inspectionsLocal/redundantSamConstructor/simple.kt.after @@ -1,7 +1,5 @@ fun test() { - Foo.Bar().bar( - { - true - } - ) + Foo.Bar().bar({ + true + }) } \ No newline at end of file diff --git a/idea/testData/intentions/branched/doubleBangToIfThen/exceptionTextHandlesMultiline.kt.after b/idea/testData/intentions/branched/doubleBangToIfThen/exceptionTextHandlesMultiline.kt.after index c3c7ef0a73a..62e01fdfc46 100644 --- a/idea/testData/intentions/branched/doubleBangToIfThen/exceptionTextHandlesMultiline.kt.after +++ b/idea/testData/intentions/branched/doubleBangToIfThen/exceptionTextHandlesMultiline.kt.after @@ -1,10 +1,8 @@ // WITH_RUNTIME fun main(args: Array) { - val doSomething = doSomething( - "one" + 1, + val doSomething = doSomething("one" + 1, "two", - 3 * 4 - ) + 3 * 4) val t = if (doSomething != null) doSomething else throw NullPointerException("Expression 'doSomething(\"one\" + 1, ...' must not be null") } diff --git a/idea/testData/intentions/convertSecondaryConstructorToPrimary/withComments.kt.after b/idea/testData/intentions/convertSecondaryConstructorToPrimary/withComments.kt.after index 97ad1c203df..dcc3cce5813 100644 --- a/idea/testData/intentions/convertSecondaryConstructorToPrimary/withComments.kt.after +++ b/idea/testData/intentions/convertSecondaryConstructorToPrimary/withComments.kt.after @@ -5,7 +5,6 @@ class WithComments/* Some parameter */ /** * A very important property */ - val veryImportant: Any -) { + val veryImportant: Any) { } \ No newline at end of file diff --git a/idea/testData/intentions/convertSecondaryConstructorToPrimary/withComposedModifiers.kt.after b/idea/testData/intentions/convertSecondaryConstructorToPrimary/withComposedModifiers.kt.after index 29ba56a26bf..c8625bcf83e 100644 --- a/idea/testData/intentions/convertSecondaryConstructorToPrimary/withComposedModifiers.kt.after +++ b/idea/testData/intentions/convertSecondaryConstructorToPrimary/withComposedModifiers.kt.after @@ -2,9 +2,7 @@ annotation class AnnParam annotation class AnnProperty -abstract class WithComposedModifiers( - @AnnParam vararg @AnnProperty - open val x: String -) { +abstract class WithComposedModifiers(@AnnParam vararg @AnnProperty +open val x: String) { } \ No newline at end of file diff --git a/idea/testData/intentions/lambdaToAnonymousFunction/argument.kt.after b/idea/testData/intentions/lambdaToAnonymousFunction/argument.kt.after index b7fef47be8d..90bae7d800b 100644 --- a/idea/testData/intentions/lambdaToAnonymousFunction/argument.kt.after +++ b/idea/testData/intentions/lambdaToAnonymousFunction/argument.kt.after @@ -1,9 +1,7 @@ fun foo(f: (Int) -> String) {} fun test() { - foo( - fun(it: Int): String { - return "" - } - ) + foo(fun(it: Int): String { + return "" + }) } \ No newline at end of file diff --git a/idea/testData/intentions/lambdaToAnonymousFunction/explicitParameterName.kt.after b/idea/testData/intentions/lambdaToAnonymousFunction/explicitParameterName.kt.after index 9cb92ff3363..81ddd1e9ddc 100644 --- a/idea/testData/intentions/lambdaToAnonymousFunction/explicitParameterName.kt.after +++ b/idea/testData/intentions/lambdaToAnonymousFunction/explicitParameterName.kt.after @@ -1,9 +1,7 @@ fun bar(f: (Int, Int) -> String) {} fun test() { - bar( - fun(i: Int, j: Int): String { - return "$i$j" - } - ) + bar(fun(i: Int, j: Int): String { + return "$i$j" + }) } \ No newline at end of file diff --git a/idea/testData/intentions/lambdaToAnonymousFunction/extention1.kt.after b/idea/testData/intentions/lambdaToAnonymousFunction/extention1.kt.after index d315899c9e7..a1c5dfc3eb9 100644 --- a/idea/testData/intentions/lambdaToAnonymousFunction/extention1.kt.after +++ b/idea/testData/intentions/lambdaToAnonymousFunction/extention1.kt.after @@ -2,9 +2,7 @@ class Foo fun bar(f: Foo.() -> Unit) {} fun main(args: Array) { - bar( - fun Foo.() { + bar(fun Foo.() { - } - ) + }) } \ No newline at end of file diff --git a/idea/testData/intentions/lambdaToAnonymousFunction/extention2.kt.after b/idea/testData/intentions/lambdaToAnonymousFunction/extention2.kt.after index 33abe29da48..b0a50a43a78 100644 --- a/idea/testData/intentions/lambdaToAnonymousFunction/extention2.kt.after +++ b/idea/testData/intentions/lambdaToAnonymousFunction/extention2.kt.after @@ -2,9 +2,7 @@ class Foo fun baz(f: Foo.(i: Int, j: Int) -> Int) {} fun main(args: Array) { - baz( - fun Foo.(i: Int, j: Int): Int { - return i + j - } - ) + baz(fun Foo.(i: Int, j: Int): Int { + return i + j + }) } \ No newline at end of file diff --git a/idea/testData/intentions/lambdaToAnonymousFunction/fullyQualified.kt.after b/idea/testData/intentions/lambdaToAnonymousFunction/fullyQualified.kt.after index 941191365e9..e5217d2f383 100644 --- a/idea/testData/intentions/lambdaToAnonymousFunction/fullyQualified.kt.after +++ b/idea/testData/intentions/lambdaToAnonymousFunction/fullyQualified.kt.after @@ -6,9 +6,7 @@ import java.util.* fun foo(f: () -> ArrayDeque<*>) {} fun test() { - foo( - fun(): ArrayDeque { - return ArrayDeque() - } - ) + foo(fun(): ArrayDeque { + return ArrayDeque() + }) } diff --git a/idea/testData/intentions/lambdaToAnonymousFunction/fullyQualified_ni.kt.after b/idea/testData/intentions/lambdaToAnonymousFunction/fullyQualified_ni.kt.after index 15fae5c174a..9f04281b337 100644 --- a/idea/testData/intentions/lambdaToAnonymousFunction/fullyQualified_ni.kt.after +++ b/idea/testData/intentions/lambdaToAnonymousFunction/fullyQualified_ni.kt.after @@ -6,9 +6,7 @@ import java.util.* fun foo(f: () -> ArrayDeque<*>) {} fun test() { - foo( - fun(): ArrayDeque<*> { - return ArrayDeque() - } - ) + foo(fun(): ArrayDeque<*> { + return ArrayDeque() + }) } diff --git a/idea/testData/intentions/lambdaToAnonymousFunction/hasComment.kt.after b/idea/testData/intentions/lambdaToAnonymousFunction/hasComment.kt.after index ec0fa2a1dd2..cc7bf9cd4aa 100644 --- a/idea/testData/intentions/lambdaToAnonymousFunction/hasComment.kt.after +++ b/idea/testData/intentions/lambdaToAnonymousFunction/hasComment.kt.after @@ -1,11 +1,9 @@ fun foo(f: (Int) -> String) {} fun test() { - foo( - fun(it: Int): String { - // comment1 - return "" - // comment2 - } - ) + foo(fun(it: Int): String { + // comment1 + return "" + // comment2 + }) } \ No newline at end of file diff --git a/idea/testData/intentions/lambdaToAnonymousFunction/hasReturn1.kt.after b/idea/testData/intentions/lambdaToAnonymousFunction/hasReturn1.kt.after index 04226461f7c..086a345fb27 100644 --- a/idea/testData/intentions/lambdaToAnonymousFunction/hasReturn1.kt.after +++ b/idea/testData/intentions/lambdaToAnonymousFunction/hasReturn1.kt.after @@ -1,9 +1,7 @@ fun foo(f: (Int) -> String) {} fun test() { - foo( - fun(it: Int): String { - return "$it" - } - ) + foo(fun(it: Int): String { + return "$it" + }) } \ No newline at end of file diff --git a/idea/testData/intentions/lambdaToAnonymousFunction/hasReturn2.kt.after b/idea/testData/intentions/lambdaToAnonymousFunction/hasReturn2.kt.after index 73f3a2ce700..09659ab731d 100644 --- a/idea/testData/intentions/lambdaToAnonymousFunction/hasReturn2.kt.after +++ b/idea/testData/intentions/lambdaToAnonymousFunction/hasReturn2.kt.after @@ -1,12 +1,10 @@ fun foo(f: (Int) -> String) {} fun test() { - foo( - fun(it: Int): String { - if (it == 1) { - return "1" - } - return "$it" - } - ) + foo(fun(it: Int): String { + if (it == 1) { + return "1" + } + return "$it" + }) } \ No newline at end of file diff --git a/idea/testData/intentions/lambdaToAnonymousFunction/hasReturn3.kt.after b/idea/testData/intentions/lambdaToAnonymousFunction/hasReturn3.kt.after index 3b5ca2b3d73..edda1dfacdc 100644 --- a/idea/testData/intentions/lambdaToAnonymousFunction/hasReturn3.kt.after +++ b/idea/testData/intentions/lambdaToAnonymousFunction/hasReturn3.kt.after @@ -1,15 +1,13 @@ fun foo(f: (Int) -> String) {} fun test() { - foo( - fun(it: Int): String { - if (it == 1) { - return "1" - } else if (it == 2) { - return "2" - } else { - return "$it" - } - } - ) + foo(fun(it: Int): String { + if (it == 1) { + return "1" + } else if (it == 2) { + return "2" + } else { + return "$it" + } + }) } \ No newline at end of file diff --git a/idea/testData/intentions/lambdaToAnonymousFunction/hasReturn4.kt.after b/idea/testData/intentions/lambdaToAnonymousFunction/hasReturn4.kt.after index 3a79f70236f..c58e967242f 100644 --- a/idea/testData/intentions/lambdaToAnonymousFunction/hasReturn4.kt.after +++ b/idea/testData/intentions/lambdaToAnonymousFunction/hasReturn4.kt.after @@ -2,12 +2,10 @@ fun foo(f: (Int) -> String) {} fun test() { - foo( - fun(it: Int): String { - listOf(1).map { - return@map 2 - } - return "$it" - } - ) + foo(fun(it: Int): String { + listOf(1).map { + return@map 2 + } + return "$it" + }) } \ No newline at end of file diff --git a/idea/testData/intentions/lambdaToAnonymousFunction/hasSomeStatements.kt.after b/idea/testData/intentions/lambdaToAnonymousFunction/hasSomeStatements.kt.after index 742ebf3e105..831d4f1ffed 100644 --- a/idea/testData/intentions/lambdaToAnonymousFunction/hasSomeStatements.kt.after +++ b/idea/testData/intentions/lambdaToAnonymousFunction/hasSomeStatements.kt.after @@ -1,10 +1,8 @@ fun foo(f: (Int) -> String) {} fun test() { - foo( - fun(it: Int): String { - val b = it == 1 - return if (b) "1" else "2" - } - ) + foo(fun(it: Int): String { + val b = it == 1 + return if (b) "1" else "2" + }) } \ No newline at end of file diff --git a/idea/testData/intentions/lambdaToAnonymousFunction/implicitParameterName.kt.after b/idea/testData/intentions/lambdaToAnonymousFunction/implicitParameterName.kt.after index 04226461f7c..086a345fb27 100644 --- a/idea/testData/intentions/lambdaToAnonymousFunction/implicitParameterName.kt.after +++ b/idea/testData/intentions/lambdaToAnonymousFunction/implicitParameterName.kt.after @@ -1,9 +1,7 @@ fun foo(f: (Int) -> String) {} fun test() { - foo( - fun(it: Int): String { - return "$it" - } - ) + foo(fun(it: Int): String { + return "$it" + }) } \ No newline at end of file diff --git a/idea/testData/intentions/lambdaToAnonymousFunction/javaMethod.kt.after b/idea/testData/intentions/lambdaToAnonymousFunction/javaMethod.kt.after index 167a115c7ec..700ba6055bc 100644 --- a/idea/testData/intentions/lambdaToAnonymousFunction/javaMethod.kt.after +++ b/idea/testData/intentions/lambdaToAnonymousFunction/javaMethod.kt.after @@ -1,7 +1,5 @@ fun main() { - Test().foo( - fun(it: Int) { + Test().foo(fun(it: Int) { - } - ) + }) } \ No newline at end of file diff --git a/idea/testData/intentions/lambdaToAnonymousFunction/namedArgument.kt.after b/idea/testData/intentions/lambdaToAnonymousFunction/namedArgument.kt.after index 1d8f79cebab..ff91e9e8cb6 100644 --- a/idea/testData/intentions/lambdaToAnonymousFunction/namedArgument.kt.after +++ b/idea/testData/intentions/lambdaToAnonymousFunction/namedArgument.kt.after @@ -3,6 +3,5 @@ fun baz(name: String, f: (Int) -> String) {} fun test() { baz(name = "", f = fun(it: Int): String { return "$it" - } - ) + }) } \ No newline at end of file diff --git a/idea/testData/intentions/lambdaToAnonymousFunction/noParameter.kt.after b/idea/testData/intentions/lambdaToAnonymousFunction/noParameter.kt.after index 8b1e712eedd..179a9737ed0 100644 --- a/idea/testData/intentions/lambdaToAnonymousFunction/noParameter.kt.after +++ b/idea/testData/intentions/lambdaToAnonymousFunction/noParameter.kt.after @@ -1,9 +1,7 @@ fun foo(f: () -> String) {} fun test() { - foo( - fun(): String { - return "" - } - ) + foo(fun(): String { + return "" + }) } \ No newline at end of file diff --git a/idea/testData/intentions/lambdaToAnonymousFunction/returnUnit.kt.after b/idea/testData/intentions/lambdaToAnonymousFunction/returnUnit.kt.after index 1afdd28f8a0..b350eff4b22 100644 --- a/idea/testData/intentions/lambdaToAnonymousFunction/returnUnit.kt.after +++ b/idea/testData/intentions/lambdaToAnonymousFunction/returnUnit.kt.after @@ -3,10 +3,8 @@ fun unit(f: (Int) -> Unit) {} fun foo(i: Int) {} fun test() { - unit( - fun(it: Int) { - foo(it) - foo(it) - } - ) + unit(fun(it: Int) { + foo(it) + foo(it) + }) } \ No newline at end of file diff --git a/idea/testData/intentions/lambdaToAnonymousFunction/withPackage.kt.after b/idea/testData/intentions/lambdaToAnonymousFunction/withPackage.kt.after index b962f8400b2..79460815a32 100644 --- a/idea/testData/intentions/lambdaToAnonymousFunction/withPackage.kt.after +++ b/idea/testData/intentions/lambdaToAnonymousFunction/withPackage.kt.after @@ -7,9 +7,7 @@ data class My(val x: Int) fun foo(f: () -> My) {} fun test() { - foo( - fun(): My { - return My(42) - } - ) + foo(fun(): My { + return My(42) + }) } diff --git a/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda1.kt.after b/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda1.kt.after index d5b0cdc8acf..22113a0b5b6 100644 --- a/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda1.kt.after +++ b/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda1.kt.after @@ -1,10 +1,8 @@ // IS_APPLICABLE: true fun foo() { - bar(2, - { - it * 3 - } - ) + bar(2, { + it * 3 + }) } fun bar(a: Int, b: (Int) -> Int) { diff --git a/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda13.kt.after b/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda13.kt.after index faeef86c6d5..9896b5b18ec 100644 --- a/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda13.kt.after +++ b/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda13.kt.after @@ -1,10 +1,8 @@ // IS_APPLICABLE: true fun foo() { - bar( - b = { - it * 3 - } - ) + bar(b = { + it * 3 + }) } fun bar(a : Int = 2, b: (Int) -> Int) { diff --git a/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda14.kt.after b/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda14.kt.after index dd4eda1e2c3..5e5a9a81866 100644 --- a/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda14.kt.after +++ b/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda14.kt.after @@ -1,10 +1,8 @@ // IS_APPLICABLE: true fun foo() { - bar(1, - b = { - it * 3 - } - ) + bar(1, b = { + it * 3 + }) } fun bar(c: Int, a: Int = 2, b: (Int) -> Int) { diff --git a/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda3.kt.after b/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda3.kt.after index 04dd0a95087..ea70185af52 100644 --- a/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda3.kt.after +++ b/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda3.kt.after @@ -1,11 +1,9 @@ // IS_APPLICABLE: true fun foo() { - bar(2, - { - val x = 3 - it * x - } - ) + bar(2, { + val x = 3 + it * x + }) } fun bar(a: Int, b: (Int) -> Int) { diff --git a/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda4.kt.after b/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda4.kt.after index 8d2f66f46f1..24d9a00974a 100644 --- a/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda4.kt.after +++ b/idea/testData/intentions/moveLambdaInsideParentheses/moveLambda4.kt.after @@ -1,11 +1,9 @@ // IS_APPLICABLE: true fun foo() { - bar(a = 2, - b = { - val x = 3 - it * x - } - ) + bar(a = 2, b = { + val x = 3 + it * x + }) } fun bar(a: Int, b: (Int) -> Int) { diff --git a/idea/testData/intentions/objectLiteralToLambda/QualifiedReturn.kt.after b/idea/testData/intentions/objectLiteralToLambda/QualifiedReturn.kt.after index 58ccc566480..6e1da0c3d8a 100644 --- a/idea/testData/intentions/objectLiteralToLambda/QualifiedReturn.kt.after +++ b/idea/testData/intentions/objectLiteralToLambda/QualifiedReturn.kt.after @@ -3,13 +3,11 @@ fun foo(runnable: Runnable) {} fun bar(list: List) { - foo( - Runnable { - list.filter(fun (element: String): Boolean { - if (element == "a") return false - if (element == "b") return@Runnable - return true - }) - } - ) + foo(Runnable { + list.filter(fun (element: String): Boolean { + if (element == "a") return false + if (element == "b") return@Runnable + return true + }) + }) } diff --git a/idea/testData/intentions/objectLiteralToLambda/ReturnNoValue.kt.after b/idea/testData/intentions/objectLiteralToLambda/ReturnNoValue.kt.after index d155c03c870..8fca6b5e8fa 100644 --- a/idea/testData/intentions/objectLiteralToLambda/ReturnNoValue.kt.after +++ b/idea/testData/intentions/objectLiteralToLambda/ReturnNoValue.kt.after @@ -3,11 +3,9 @@ fun foo(runnable: Runnable) {} fun bar(p: Int) { - foo( - Runnable { - if (p < 0) return@Runnable - println("a") - println("b") - } - ) + foo(Runnable { + if (p < 0) return@Runnable + println("a") + println("b") + }) } \ No newline at end of file diff --git a/idea/testData/intentions/objectLiteralToLambda/ReturnNotLast.kt.after b/idea/testData/intentions/objectLiteralToLambda/ReturnNotLast.kt.after index 7e569d712e7..cdf08d56a55 100644 --- a/idea/testData/intentions/objectLiteralToLambda/ReturnNotLast.kt.after +++ b/idea/testData/intentions/objectLiteralToLambda/ReturnNotLast.kt.after @@ -5,10 +5,8 @@ import java.io.FilenameFilter fun foo(filter: FilenameFilter) {} fun bar() { - foo( - FilenameFilter { file, name -> - if (file.isDirectory) return@FilenameFilter true - name == "x" - } - ) + foo(FilenameFilter { file, name -> + if (file.isDirectory) return@FilenameFilter true + name == "x" + }) } diff --git a/idea/testData/intentions/objectLiteralToLambda/ReturnsInIf.kt.after b/idea/testData/intentions/objectLiteralToLambda/ReturnsInIf.kt.after index 880169ad0a4..d7670e97b87 100644 --- a/idea/testData/intentions/objectLiteralToLambda/ReturnsInIf.kt.after +++ b/idea/testData/intentions/objectLiteralToLambda/ReturnsInIf.kt.after @@ -5,20 +5,18 @@ import java.io.FileFilter fun foo(filter: FileFilter) {} fun bar() { - foo( - FileFilter { file -> - val name = file.name - if (name.startsWith("a")) { - false - } - else { - if (name.endsWith("b")) - true - else { - val l = name.length - l > 10 - } - } + foo(FileFilter { file -> + val name = file.name + if (name.startsWith("a")) { + false + } + else { + if (name.endsWith("b")) + true + else { + val l = name.length + l > 10 } - ) + } + }) } diff --git a/idea/testData/intentions/objectLiteralToLambda/ReturnsInWhen.kt.after b/idea/testData/intentions/objectLiteralToLambda/ReturnsInWhen.kt.after index c8905be43b5..6557197a43e 100644 --- a/idea/testData/intentions/objectLiteralToLambda/ReturnsInWhen.kt.after +++ b/idea/testData/intentions/objectLiteralToLambda/ReturnsInWhen.kt.after @@ -5,19 +5,17 @@ import java.io.FileFilter fun foo(filter: FileFilter) {} fun bar() { - foo( - FileFilter { file -> - val name = file.name - when (name) { - "foo" -> true + foo(FileFilter { file -> + val name = file.name + when (name) { + "foo" -> true - "bar" -> false + "bar" -> false - else -> { - if (name.startsWith("a")) return@FileFilter true - false - } - } + else -> { + if (name.startsWith("a")) return@FileFilter true + false } - ) + } + }) } diff --git a/idea/testData/intentions/objectLiteralToLambda/SamAdapterNeededBecauseOfLabeledReturn.kt.after b/idea/testData/intentions/objectLiteralToLambda/SamAdapterNeededBecauseOfLabeledReturn.kt.after index 726879dc83b..688d0a8cd5c 100644 --- a/idea/testData/intentions/objectLiteralToLambda/SamAdapterNeededBecauseOfLabeledReturn.kt.after +++ b/idea/testData/intentions/objectLiteralToLambda/SamAdapterNeededBecauseOfLabeledReturn.kt.after @@ -3,10 +3,8 @@ import javax.swing.SwingUtilities fun bar(p: Int) { - SwingUtilities.invokeLater( - Runnable { - if (p < 0) return@Runnable - throw UnsupportedOperationException() - } - ) + SwingUtilities.invokeLater(Runnable { + if (p < 0) return@Runnable + throw UnsupportedOperationException() + }) } \ No newline at end of file diff --git a/idea/testData/intentions/objectLiteralToLambda/StatementAndReturn.kt.after b/idea/testData/intentions/objectLiteralToLambda/StatementAndReturn.kt.after index e79d119e493..612cdb4b03d 100644 --- a/idea/testData/intentions/objectLiteralToLambda/StatementAndReturn.kt.after +++ b/idea/testData/intentions/objectLiteralToLambda/StatementAndReturn.kt.after @@ -5,10 +5,8 @@ import java.io.FileFilter fun foo(filter: FileFilter) {} fun bar() { - foo( - FileFilter { file -> - val name = file.name - name.startsWith("a") - } - ) + foo(FileFilter { file -> + val name = file.name + name.startsWith("a") + }) } diff --git a/idea/testData/intentions/operatorToFunction/keepComments.kt.after b/idea/testData/intentions/operatorToFunction/keepComments.kt.after index 46bb53b075d..b23549c9a76 100644 --- a/idea/testData/intentions/operatorToFunction/keepComments.kt.after +++ b/idea/testData/intentions/operatorToFunction/keepComments.kt.after @@ -4,9 +4,7 @@ interface C { class D(val c: C) { fun foo() { - this.c/* and this is c */.set( - "a", // it's "a" - "b" /* and this is "b" */, /* we use 10 */10 - ) + this.c/* and this is c */.set("a", // it's "a" + "b" /* and this is "b" */, /* we use 10 */10) } } diff --git a/idea/testData/intentions/samConversionToAnonymousObject/nestedClass.kt.after b/idea/testData/intentions/samConversionToAnonymousObject/nestedClass.kt.after index 06721000673..51f7a399228 100644 --- a/idea/testData/intentions/samConversionToAnonymousObject/nestedClass.kt.after +++ b/idea/testData/intentions/samConversionToAnonymousObject/nestedClass.kt.after @@ -1,9 +1,7 @@ fun main() { - J().foo( - object : J.Sam { - override fun bar() { + J().foo(object : J.Sam { + override fun bar() { - } - } - ) + } + }) } diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/addArguments.kt.after b/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/addArguments.kt.after index 20c4646f4cb..0cd34007e18 100644 --- a/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/addArguments.kt.after +++ b/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/addArguments.kt.after @@ -7,9 +7,7 @@ fun newFun(p1: Int, a: Int, p2: Int, p3: Int, b: Int){} fun foo() { - newFun( - 0, // 0 + newFun(0, // 0 -1, 1, // 1 2, // 2 - -2 - ) + -2) diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/commentBeforeArgument.kt.after b/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/commentBeforeArgument.kt.after index c8fa6dc09ed..1ab6cf8d55e 100644 --- a/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/commentBeforeArgument.kt.after +++ b/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/commentBeforeArgument.kt.after @@ -7,12 +7,7 @@ fun newFun(p4: Int, p3: Int, p2: Int, p1: Int, p0: Int){} fun foo() { - newFun( -/* 4 */ - 4, 3, 2, // 2 - /* 1 */ - 1, - /* 0 */ - 0 - ) + newFun(/* 4 */ 4, 3, 2, // 2 + /* 1 */ 1, + /* 0 */ 0) } diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/multipleArguments.kt.after b/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/multipleArguments.kt.after index 5912a5f7f51..b1565b42df9 100644 --- a/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/multipleArguments.kt.after +++ b/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/multipleArguments.kt.after @@ -8,8 +8,7 @@ interface X { fun newFun(x: X, a: Int, b: Int){} fun foo(x: X) { - newFun( - x/*receiver*/, 1, // pass 1 + newFun(x/*receiver*/, 1, // pass 1 2 // pass 2 ) } diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/addArgument.kt.after b/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/addArgument.kt.after index 6e2a8b03e2c..fc116e658a2 100644 --- a/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/addArgument.kt.after +++ b/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/addArgument.kt.after @@ -11,6 +11,5 @@ fun foo(x: X) { x.newFun( 1, 2, - 0 - ) + 0) } diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/simple.kt.after b/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/simple.kt.after index 9d0258c3363..56f9d27ce03 100644 --- a/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/simple.kt.after +++ b/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/simple.kt.after @@ -8,9 +8,7 @@ interface X { } fun foo(x: X) { - x.newFun( - 1, + x.newFun(1, 2, - 3 - ) + 3) } diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/optionalParameters/optionalParameterAndLambda.kt.after b/idea/testData/quickfix/deprecatedSymbolUsage/optionalParameters/optionalParameterAndLambda.kt.after index bee6b946816..f926222f2b9 100644 --- a/idea/testData/quickfix/deprecatedSymbolUsage/optionalParameters/optionalParameterAndLambda.kt.after +++ b/idea/testData/quickfix/deprecatedSymbolUsage/optionalParameters/optionalParameterAndLambda.kt.after @@ -18,9 +18,7 @@ fun useSimple(s: Int): Int { fun println(s: String) {} fun useIt() { - val t = useSimple( - simple { - println("abc") - } - ) + val t = useSimple(simple { + println("abc") + }) } \ No newline at end of file diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/optionalParameters/optionalParameterAndLambdaComplex.kt.after b/idea/testData/quickfix/deprecatedSymbolUsage/optionalParameters/optionalParameterAndLambdaComplex.kt.after index 702b3e0c5e2..8bdc3d7ab68 100644 --- a/idea/testData/quickfix/deprecatedSymbolUsage/optionalParameters/optionalParameterAndLambdaComplex.kt.after +++ b/idea/testData/quickfix/deprecatedSymbolUsage/optionalParameters/optionalParameterAndLambdaComplex.kt.after @@ -36,6 +36,5 @@ fun createHi(any: Any) = "Hi $any" val unDeprecateMe = mutableListOf("Hello").apply { addA(d(::createHi, 1 ) { // Run the quick fix from the IDE and watch it produce broken code. println("Yo") - }, Unit - ) + }, Unit) } \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignature/AddParameterKeepFormatAfter.kt b/idea/testData/refactoring/changeSignature/AddParameterKeepFormatAfter.kt index 1bb5d3bc547..ca392c3cf99 100644 --- a/idea/testData/refactoring/changeSignature/AddParameterKeepFormatAfter.kt +++ b/idea/testData/refactoring/changeSignature/AddParameterKeepFormatAfter.kt @@ -3,19 +3,15 @@ fun foo(a: Int, b: Int, d: Int, c: Int, e: Int) { } fun test() { - foo( - 1, + foo(1, 2, 4, 3, - 5 - ) - foo( - 1, 2, + 5) + foo(1, 2, 4, 3, - 5 - ) + 5) foo( 1, 2, diff --git a/idea/testData/refactoring/changeSignature/MoveLambdaParameterAfter.kt b/idea/testData/refactoring/changeSignature/MoveLambdaParameterAfter.kt index 5acad349498..e344318959f 100644 --- a/idea/testData/refactoring/changeSignature/MoveLambdaParameterAfter.kt +++ b/idea/testData/refactoring/changeSignature/MoveLambdaParameterAfter.kt @@ -3,11 +3,7 @@ fun foo(x: Int, cl: () -> Int, y: Int): Int { } fun bar() { - foo( - 1, - { - 3 - }, - 2 - ) + foo(1, { + 3 + }, 2) } \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignature/NoDefaultValuesInOverridesAfter.kt b/idea/testData/refactoring/changeSignature/NoDefaultValuesInOverridesAfter.kt index ab9799fd025..5f6a6c2bda6 100644 --- a/idea/testData/refactoring/changeSignature/NoDefaultValuesInOverridesAfter.kt +++ b/idea/testData/refactoring/changeSignature/NoDefaultValuesInOverridesAfter.kt @@ -1,24 +1,18 @@ interface T { - fun foo( - a: Int = 1, - b: String = "2" - ) + fun foo(a: Int = 1, + b: String = "2") } open class A: T { - override fun foo( - a: Int, - b: String - ) { + override fun foo(a: Int, + b: String) { throw UnsupportedOperationException() } } class B: A() { - override fun foo( - a: Int, - b: String - ) { + override fun foo(a: Int, + b: String) { throw UnsupportedOperationException() } } \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignature/RemoveParameterKeepFormat1After.kt b/idea/testData/refactoring/changeSignature/RemoveParameterKeepFormat1After.kt index c77792e95d7..7fb9579c69b 100644 --- a/idea/testData/refactoring/changeSignature/RemoveParameterKeepFormat1After.kt +++ b/idea/testData/refactoring/changeSignature/RemoveParameterKeepFormat1After.kt @@ -3,10 +3,8 @@ fun foo(b: Int, c: Int) { } fun test() { - foo( - 2, - 3 - ) + foo(2, + 3) foo(2, 3) foo( 2, diff --git a/idea/testData/refactoring/changeSignature/RemoveParameterKeepFormat2After.kt b/idea/testData/refactoring/changeSignature/RemoveParameterKeepFormat2After.kt index 2a3fe2134ca..1079d7d2fbe 100644 --- a/idea/testData/refactoring/changeSignature/RemoveParameterKeepFormat2After.kt +++ b/idea/testData/refactoring/changeSignature/RemoveParameterKeepFormat2After.kt @@ -3,10 +3,8 @@ fun foo(a: Int, c: Int) { } fun test() { - foo( - 1, - 3 - ) + foo(1, + 3) foo(1, 3) foo( 1, diff --git a/idea/testData/refactoring/changeSignature/RemoveParameterKeepFormat3After.kt b/idea/testData/refactoring/changeSignature/RemoveParameterKeepFormat3After.kt index 7ea2962b5a5..138eb4d8a75 100644 --- a/idea/testData/refactoring/changeSignature/RemoveParameterKeepFormat3After.kt +++ b/idea/testData/refactoring/changeSignature/RemoveParameterKeepFormat3After.kt @@ -3,10 +3,8 @@ fun foo(a: Int, b: Int) { } fun test() { - foo( - 1, - 2 - ) + foo(1, + 2) foo(1, 2) foo( 1, diff --git a/idea/testData/refactoring/changeSignature/SwapParametersKeepFormatAfter.kt b/idea/testData/refactoring/changeSignature/SwapParametersKeepFormatAfter.kt index b826569b5e1..80046ba50d4 100644 --- a/idea/testData/refactoring/changeSignature/SwapParametersKeepFormatAfter.kt +++ b/idea/testData/refactoring/changeSignature/SwapParametersKeepFormatAfter.kt @@ -3,15 +3,11 @@ fun foo(c: Int, b: Int, a: Int) { } fun test() { - foo( - 3, + foo(3, 2, - 1 - ) - foo( - 3, 2, - 1 - ) + 1) + foo(3, 2, + 1) foo( 3, 2, diff --git a/idea/testData/refactoring/inline/function/returnAtEnd/DefaultParameter.kt.after b/idea/testData/refactoring/inline/function/returnAtEnd/DefaultParameter.kt.after index 00fda29c9ff..096a8a85e59 100644 --- a/idea/testData/refactoring/inline/function/returnAtEnd/DefaultParameter.kt.after +++ b/idea/testData/refactoring/inline/function/returnAtEnd/DefaultParameter.kt.after @@ -3,6 +3,5 @@ fun callInDefault(simple: List = provideSimple(), complex: List val result = mutableListOf("statement 1") result.add("statement 2") result -} -) { +}) { } \ No newline at end of file diff --git a/idea/testData/refactoring/inline/function/returnAtEnd/ReturnFromLambda.kt.after b/idea/testData/refactoring/inline/function/returnAtEnd/ReturnFromLambda.kt.after index 6bf0b8643f7..7edca71c0e8 100644 --- a/idea/testData/refactoring/inline/function/returnAtEnd/ReturnFromLambda.kt.after +++ b/idea/testData/refactoring/inline/function/returnAtEnd/ReturnFromLambda.kt.after @@ -1,8 +1,6 @@ fun g() { - println( - listOf("a", "b").any { - if (it.isEmpty()) return@any false - it.length < 10 - } - ) -} \ No newline at end of file + println(listOf("a", "b").any { + if (it.isEmpty()) return@any false + it.length < 10 + }) +} diff --git a/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineBinaryExpression.kt.after b/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineBinaryExpression.kt.after index 10b7496c2fe..342fc53f9cf 100644 --- a/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineBinaryExpression.kt.after +++ b/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineBinaryExpression.kt.after @@ -1,10 +1,8 @@ fun foo(i: Int) { } -fun test( - i: () -> Int = { - (1 - + 2) - } -) { +fun test(i: () -> Int = { + (1 + + 2) +}) { foo(i()) } \ No newline at end of file diff --git a/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineBinaryExpressionWithComments.kt.after b/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineBinaryExpressionWithComments.kt.after index 17464f64e2c..89f2f50f6d8 100644 --- a/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineBinaryExpressionWithComments.kt.after +++ b/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineBinaryExpressionWithComments.kt.after @@ -1,10 +1,8 @@ fun foo(i: Int) { } -fun test( - i: () -> Int = { - (1 // abc - /*def*/ + 2) - } -) { +fun test(i: () -> Int = { + (1 // abc + /*def*/ + 2) +}) { foo(i()) } \ No newline at end of file diff --git a/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineNestedBinaryExpression1.kt.after b/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineNestedBinaryExpression1.kt.after index 8ff2200cba7..2cc60b16f6a 100644 --- a/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineNestedBinaryExpression1.kt.after +++ b/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineNestedBinaryExpression1.kt.after @@ -1,10 +1,8 @@ fun foo(i: Int) { } -fun test( - i: () -> Int = { - (1 - + 2 - 3) - } -) { +fun test(i: () -> Int = { + (1 + + 2 - 3) +}) { foo(i()) } \ No newline at end of file diff --git a/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineNestedBinaryExpression2.kt.after b/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineNestedBinaryExpression2.kt.after index a16d4c690cb..86a45908394 100644 --- a/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineNestedBinaryExpression2.kt.after +++ b/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineNestedBinaryExpression2.kt.after @@ -1,10 +1,8 @@ fun foo(i: Int) { } -fun test( - i: () -> Int = { - (1 + 2 - - 3) - } -) { +fun test(i: () -> Int = { + (1 + 2 + - 3) +}) { foo(i()) } \ No newline at end of file diff --git a/idea/testData/refactoring/introduceLambdaParameter/stringTemplates/rawTemplateWithSubstring.kt.after b/idea/testData/refactoring/introduceLambdaParameter/stringTemplates/rawTemplateWithSubstring.kt.after index 93620a73545..94a910e4aa9 100644 --- a/idea/testData/refactoring/introduceLambdaParameter/stringTemplates/rawTemplateWithSubstring.kt.after +++ b/idea/testData/refactoring/introduceLambdaParameter/stringTemplates/rawTemplateWithSubstring.kt.after @@ -1,10 +1,7 @@ -fun foo( - a: Int, - s: (Int) -> String = { a -> - """c$a +fun foo(a: Int, s: (Int) -> String = { a -> + """c$a :${a + 1}d""" - } -): String { +}): String { val x = """_${s(a)}_""" val y = "_$a:${a + 1}d_" val z = """_c$a:${a + 1}d_""" diff --git a/idea/testData/refactoring/introduceParameter/multiline/multilineBinaryExpression.kt.after b/idea/testData/refactoring/introduceParameter/multiline/multilineBinaryExpression.kt.after index dd63801f420..b782cb407cf 100644 --- a/idea/testData/refactoring/introduceParameter/multiline/multilineBinaryExpression.kt.after +++ b/idea/testData/refactoring/introduceParameter/multiline/multilineBinaryExpression.kt.after @@ -1,8 +1,6 @@ fun foo(i: Int) { } -fun test( - i: Int = (1 - + 2) -) { +fun test(i: Int = (1 + + 2)) { foo(i) } \ No newline at end of file diff --git a/idea/testData/refactoring/introduceParameter/multiline/multilineBinaryExpressionWithComments.kt.after b/idea/testData/refactoring/introduceParameter/multiline/multilineBinaryExpressionWithComments.kt.after index 7fa3c2c9a2e..4fffbdfb58e 100644 --- a/idea/testData/refactoring/introduceParameter/multiline/multilineBinaryExpressionWithComments.kt.after +++ b/idea/testData/refactoring/introduceParameter/multiline/multilineBinaryExpressionWithComments.kt.after @@ -1,8 +1,6 @@ fun foo(i: Int) { } -fun test( - i: Int = (1 // abc - /*def*/ + 2) -) { +fun test(i: Int = (1 // abc + /*def*/ + 2)) { foo(i) } \ No newline at end of file diff --git a/idea/testData/refactoring/introduceParameter/multiline/multilineNestedBinaryExpression1.kt.after b/idea/testData/refactoring/introduceParameter/multiline/multilineNestedBinaryExpression1.kt.after index f6e6786faf9..d47e0d33aef 100644 --- a/idea/testData/refactoring/introduceParameter/multiline/multilineNestedBinaryExpression1.kt.after +++ b/idea/testData/refactoring/introduceParameter/multiline/multilineNestedBinaryExpression1.kt.after @@ -1,8 +1,6 @@ fun foo(i: Int) { } -fun test( - i: Int = (1 - + 2 - 3) -) { +fun test(i: Int = (1 + + 2 - 3)) { foo(i) } \ No newline at end of file diff --git a/idea/testData/refactoring/introduceParameter/multiline/multilineNestedBinaryExpression2.kt.after b/idea/testData/refactoring/introduceParameter/multiline/multilineNestedBinaryExpression2.kt.after index b2f77d6b3cd..d662fb497ca 100644 --- a/idea/testData/refactoring/introduceParameter/multiline/multilineNestedBinaryExpression2.kt.after +++ b/idea/testData/refactoring/introduceParameter/multiline/multilineNestedBinaryExpression2.kt.after @@ -1,8 +1,6 @@ fun foo(i: Int) { } -fun test( - i: Int = (1 + 2 - - 3) -) { +fun test(i: Int = (1 + 2 + - 3)) { foo(i) } \ No newline at end of file diff --git a/idea/testData/refactoring/introduceParameter/stringTemplates/rawTemplateWithSubstring.kt.after b/idea/testData/refactoring/introduceParameter/stringTemplates/rawTemplateWithSubstring.kt.after index 6b6d96b62ba..f6fa52c447a 100644 --- a/idea/testData/refactoring/introduceParameter/stringTemplates/rawTemplateWithSubstring.kt.after +++ b/idea/testData/refactoring/introduceParameter/stringTemplates/rawTemplateWithSubstring.kt.after @@ -1,8 +1,5 @@ -fun foo( - a: Int, - s: String = """c$a - :${a + 1}d""" -): String { +fun foo(a: Int, s: String = """c$a + :${a + 1}d"""): String { val x = """_${s}_""" val y = "_$a:${a + 1}d_" val z = """_c$a:${a + 1}d_""" diff --git a/idea/testData/refactoring/rename/inplace/InvokeToGetWithQualifiedExpr.kt.after b/idea/testData/refactoring/rename/inplace/InvokeToGetWithQualifiedExpr.kt.after index 0a4182da574..06125e12e12 100644 --- a/idea/testData/refactoring/rename/inplace/InvokeToGetWithQualifiedExpr.kt.after +++ b/idea/testData/refactoring/rename/inplace/InvokeToGetWithQualifiedExpr.kt.after @@ -10,10 +10,8 @@ fun boo(s: Second, body: () -> Unit) { } fun foo(s: Second) { boo(s) { - s.testInvoke[ - { + s.testInvoke[{ "Hello" - } - ] + }] } } \ No newline at end of file diff --git a/idea/testData/refactoring/rename/inplace/InvokeToGetWithSafeQualifiedExpr.kt.after b/idea/testData/refactoring/rename/inplace/InvokeToGetWithSafeQualifiedExpr.kt.after index 7b828ef5062..a0ff1b1ef26 100644 --- a/idea/testData/refactoring/rename/inplace/InvokeToGetWithSafeQualifiedExpr.kt.after +++ b/idea/testData/refactoring/rename/inplace/InvokeToGetWithSafeQualifiedExpr.kt.after @@ -10,10 +10,8 @@ fun boo(s: Second?, body: () -> Unit) { } fun foo(s: Second?) { boo(s) { - s?.testInvoke[ - { + s?.testInvoke[{ "Hello" - } - ] + }] } } \ No newline at end of file diff --git a/j2k/testData/fileOrElement/annotations/annotationFromConstructorParamToProperty.kt b/j2k/testData/fileOrElement/annotations/annotationFromConstructorParamToProperty.kt index ce61b2f1aac..7d881336a79 100644 --- a/j2k/testData/fileOrElement/annotations/annotationFromConstructorParamToProperty.kt +++ b/j2k/testData/fileOrElement/annotations/annotationFromConstructorParamToProperty.kt @@ -2,7 +2,5 @@ internal annotation class A internal annotation class B -class U( - @param:A @field:B - var i: Int -) \ No newline at end of file +class U(@param:A @field:B + var i: Int) \ No newline at end of file diff --git a/j2k/testData/fileOrElement/annotations/annotationInterface1.kt b/j2k/testData/fileOrElement/annotations/annotationInterface1.kt index 008374661fc..e33b17a5db4 100644 --- a/j2k/testData/fileOrElement/annotations/annotationInterface1.kt +++ b/j2k/testData/fileOrElement/annotations/annotationInterface1.kt @@ -1,7 +1,5 @@ -internal annotation class Anon( - val stringArray: Array, val intArray: IntArray, // string - val string: String -) +internal annotation class Anon(val stringArray: Array, val intArray: IntArray, // string + val string: String) @Anon(string = "a", stringArray = ["a", "b"], intArray = [1, 2]) @Target(AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FIELD) diff --git a/j2k/testData/fileOrElement/comments/fieldsInitializedFromParams.kt b/j2k/testData/fileOrElement/comments/fieldsInitializedFromParams.kt index 27aaf7596c2..5941ce3034e 100644 --- a/j2k/testData/fileOrElement/comments/fieldsInitializedFromParams.kt +++ b/j2k/testData/fileOrElement/comments/fieldsInitializedFromParams.kt @@ -1,5 +1,6 @@ internal class C( - private val p1: Int, /* parameter p1 */ // field p1 + private val p1: Int /* parameter p1 */ // field p1 + , /** * Field myP2 */ diff --git a/j2k/testData/fileOrElement/constructors/lineBreaksBetweenParameters.kt b/j2k/testData/fileOrElement/constructors/lineBreaksBetweenParameters.kt index 494b08d1b9a..0a6d3da32eb 100644 --- a/j2k/testData/fileOrElement/constructors/lineBreaksBetweenParameters.kt +++ b/j2k/testData/fileOrElement/constructors/lineBreaksBetweenParameters.kt @@ -1,18 +1,12 @@ -internal class C1( - arg1: Int, - arg2: Int, - arg3: Int -) { +internal class C1(arg1: Int, + arg2: Int, + arg3: Int) { - constructor( - x: Int, - y: Int - ) : this(x, x + y, 0) { + constructor(x: Int, + y: Int) : this(x, x + y, 0) { } } -internal class C2( - private val arg1: Int, - private val arg2: Int, - arg3: Int -) +internal class C2(private val arg1: Int, + private val arg2: Int, + arg3: Int) diff --git a/j2k/testData/fileOrElement/detectProperties/Comments.kt b/j2k/testData/fileOrElement/detectProperties/Comments.kt index c0d45a0a766..692957db0cb 100644 --- a/j2k/testData/fileOrElement/detectProperties/Comments.kt +++ b/j2k/testData/fileOrElement/detectProperties/Comments.kt @@ -1,5 +1,4 @@ -internal class A( -// comment for field2 getter +internal class A(// comment for field2 getter // comment for field2 setter var field2: Int // comment for field2 ) { diff --git a/j2k/testData/fileOrElement/detectProperties/DataClassWithAnnotations.kt b/j2k/testData/fileOrElement/detectProperties/DataClassWithAnnotations.kt index dd0388d7b83..32a1abee831 100644 --- a/j2k/testData/fileOrElement/detectProperties/DataClassWithAnnotations.kt +++ b/j2k/testData/fileOrElement/detectProperties/DataClassWithAnnotations.kt @@ -1,8 +1,6 @@ internal annotation class TestAnnotation -class Test( - @param:TestAnnotation @field:TestAnnotation - @get:TestAnnotation - @set:TestAnnotation - var arg: String? -) +class Test(@param:TestAnnotation @field:TestAnnotation + @get:TestAnnotation + @set:TestAnnotation + var arg: String?) diff --git a/j2k/testData/fileOrElement/docComments/deprecatedDocTagWithMultiLineMessage.kt b/j2k/testData/fileOrElement/docComments/deprecatedDocTagWithMultiLineMessage.kt index f137c9bc2a2..44c6c6832b9 100644 --- a/j2k/testData/fileOrElement/docComments/deprecatedDocTagWithMultiLineMessage.kt +++ b/j2k/testData/fileOrElement/docComments/deprecatedDocTagWithMultiLineMessage.kt @@ -1,9 +1,7 @@ -@Deprecated( - "Ph'nglui mglw'nafh\n" + - " Cthulhu R'lyeh wgah'nagl fhtagn.\n" + - " 'In His House at R'lyeh\n" + - " Dead Cthulhu waits dreaming,\n" + - " yet He shall rise and His kingdom\n" + - " shall cover the Earth.'" -) +@Deprecated("Ph'nglui mglw'nafh\n" + + " Cthulhu R'lyeh wgah'nagl fhtagn.\n" + + " 'In His House at R'lyeh\n" + + " Dead Cthulhu waits dreaming,\n" + + " yet He shall rise and His kingdom\n" + + " shall cover the Earth.'") class TestDeprecatedInJavadocWithMultilineMessage \ No newline at end of file diff --git a/j2k/testData/fileOrElement/enum/runnableImplementation.kt b/j2k/testData/fileOrElement/enum/runnableImplementation.kt index 5cb176d088f..099aa79fa68 100644 --- a/j2k/testData/fileOrElement/enum/runnableImplementation.kt +++ b/j2k/testData/fileOrElement/enum/runnableImplementation.kt @@ -2,9 +2,7 @@ internal enum class Color : Runnable { WHITE, BLACK, RED, YELLOW, BLUE; override fun run() { - println( - "name()=" + name + - ", toString()=" + toString() - ) + println("name()=" + name + + ", toString()=" + toString()) } } \ No newline at end of file diff --git a/j2k/testData/fileOrElement/formatting/lineBreaksBetweenArguments.kt b/j2k/testData/fileOrElement/formatting/lineBreaksBetweenArguments.kt index 5438a97bf1f..af66aa1a53c 100644 --- a/j2k/testData/fileOrElement/formatting/lineBreaksBetweenArguments.kt +++ b/j2k/testData/fileOrElement/formatting/lineBreaksBetweenArguments.kt @@ -2,10 +2,9 @@ internal class F { fun f1(p1: Int, p2: Int, p3: Int, p4: Int, vararg p5: Int) {} fun f2(array: IntArray) { - f1( - 1, 2, + f1(1, 2, 3, 4, *array ) } -} \ No newline at end of file +} diff --git a/j2k/testData/fileOrElement/function/lineBreaksBetweenParameters.kt b/j2k/testData/fileOrElement/function/lineBreaksBetweenParameters.kt index ebb6dab7a4c..56dd17ab42d 100644 --- a/j2k/testData/fileOrElement/function/lineBreaksBetweenParameters.kt +++ b/j2k/testData/fileOrElement/function/lineBreaksBetweenParameters.kt @@ -3,14 +3,11 @@ internal class C { fun foo2( p1: Int, - p2: Int - ) { + p2: Int) { } - fun foo3( - p1: Int, - p2: Int - ) { + fun foo3(p1: Int, + p2: Int) { } fun foo4( diff --git a/j2k/testData/fileOrElement/mutableCollections/FunctionParameters.kt b/j2k/testData/fileOrElement/mutableCollections/FunctionParameters.kt index bca04c44762..75d142c0c65 100644 --- a/j2k/testData/fileOrElement/mutableCollections/FunctionParameters.kt +++ b/j2k/testData/fileOrElement/mutableCollections/FunctionParameters.kt @@ -2,13 +2,11 @@ import java.util.* internal class A { - fun foo( - nonMutableCollection: Collection, + fun foo(nonMutableCollection: Collection, mutableCollection: MutableCollection, mutableSet: MutableSet, - mutableMap: MutableMap - ) { + mutableMap: MutableMap) { mutableCollection.addAll(nonMutableCollection) mutableSet.add(mutableMap.remove("a")) } -} \ No newline at end of file +} diff --git a/j2k/testData/fileOrElement/newClassExpression/lineBreaks.kt b/j2k/testData/fileOrElement/newClassExpression/lineBreaks.kt index 392b4a3b89c..3790a35a9e0 100644 --- a/j2k/testData/fileOrElement/newClassExpression/lineBreaks.kt +++ b/j2k/testData/fileOrElement/newClassExpression/lineBreaks.kt @@ -2,10 +2,8 @@ internal class C(p1: Int, p2: Int, p3: Int) internal class User { fun foo() { - C( - 1, + C(1, 2, - 3 - ) + 3) } -} \ No newline at end of file +} diff --git a/j2k/testData/fileOrElement/objectLiteral/MyFrame.kt b/j2k/testData/fileOrElement/objectLiteral/MyFrame.kt index 868c598726d..7d717216c58 100644 --- a/j2k/testData/fileOrElement/objectLiteral/MyFrame.kt +++ b/j2k/testData/fileOrElement/objectLiteral/MyFrame.kt @@ -24,11 +24,9 @@ internal class Client : Frame() { addWindowListener(a) - addWindowListener( - object : WindowAdapter() { - override fun windowClosing() {} - } - ) + addWindowListener(object : WindowAdapter() { + override fun windowClosing() {} + }) val b = object : EmptyWindowListener { diff --git a/j2k/testData/fileOrElement/returnStatement/currentMethodBug.kt b/j2k/testData/fileOrElement/returnStatement/currentMethodBug.kt index e343de61ce0..f02c2bcde26 100644 --- a/j2k/testData/fileOrElement/returnStatement/currentMethodBug.kt +++ b/j2k/testData/fileOrElement/returnStatement/currentMethodBug.kt @@ -5,12 +5,10 @@ internal interface I { internal class C { val `object`: Any? get() { - foo( - object : I { - override val int: Int - get() = 0 - } - ) + foo(object : I { + override val int: Int + get() = 0 + }) return string } diff --git a/j2k/testData/fileOrElement/tryWithResource/WithReturnInAnonymousClass.kt b/j2k/testData/fileOrElement/tryWithResource/WithReturnInAnonymousClass.kt index a9840a6d86d..e6ff0724964 100644 --- a/j2k/testData/fileOrElement/tryWithResource/WithReturnInAnonymousClass.kt +++ b/j2k/testData/fileOrElement/tryWithResource/WithReturnInAnonymousClass.kt @@ -9,15 +9,12 @@ class C { @Throws(IOException::class) internal fun foo() { ByteArrayInputStream(ByteArray(10)).use { stream -> - bar( - object : I { - @Throws(IOException::class) - override fun doIt(stream: InputStream): Int { - return stream.available() - } - }, - stream - ) + bar(object : I { + @Throws(IOException::class) + override fun doIt(stream: InputStream): Int { + return stream.available() + } + }, stream) } } @@ -25,4 +22,4 @@ class C { internal fun bar(i: I, stream: InputStream): Int { return i.doIt(stream) } -} +} \ No newline at end of file diff --git a/j2k/testData/fileOrElement/tryWithResource/WithReturnInAnonymousClass2.kt b/j2k/testData/fileOrElement/tryWithResource/WithReturnInAnonymousClass2.kt index 9caeeb3f8f9..35673b345b7 100644 --- a/j2k/testData/fileOrElement/tryWithResource/WithReturnInAnonymousClass2.kt +++ b/j2k/testData/fileOrElement/tryWithResource/WithReturnInAnonymousClass2.kt @@ -9,15 +9,12 @@ class C { @Throws(IOException::class) internal fun foo(): Int { ByteArrayInputStream(ByteArray(10)).use { stream -> - return bar( - object : I { - @Throws(IOException::class) - override fun doIt(stream: InputStream): Int { - return stream.available() - } - }, - stream - ) + return bar(object : I { + @Throws(IOException::class) + override fun doIt(stream: InputStream): Int { + return stream.available() + } + }, stream) } } @@ -25,4 +22,4 @@ class C { internal fun bar(i: I, stream: InputStream): Int { return i.doIt(stream) } -} +} \ No newline at end of file diff --git a/nj2k/testData/newJ2k/annotations/annotationInterface1.kt b/nj2k/testData/newJ2k/annotations/annotationInterface1.kt index 1db04ce77f7..223b81ef08c 100644 --- a/nj2k/testData/newJ2k/annotations/annotationInterface1.kt +++ b/nj2k/testData/newJ2k/annotations/annotationInterface1.kt @@ -1,7 +1,5 @@ -internal annotation class Anon( - val stringArray: Array, val intArray: IntArray, // string - val string: String -) +internal annotation class Anon(val stringArray: Array, val intArray: IntArray, // string + val string: String) @Anon(string = "a", stringArray = ["a", "b"], intArray = [1, 2]) @Target(AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FIELD) diff --git a/nj2k/testData/newJ2k/annotations/kt-31726.kt b/nj2k/testData/newJ2k/annotations/kt-31726.kt index 36e36b54afd..4a2164ddacb 100644 --- a/nj2k/testData/newJ2k/annotations/kt-31726.kt +++ b/nj2k/testData/newJ2k/annotations/kt-31726.kt @@ -1,8 +1,7 @@ import javaApi.SpecialExternal //Annotation class: -annotation class Special( - val names: Array //array is used +annotation class Special(val names: Array //array is used ) //Class with annotation: @Special(names = ["name1"]) diff --git a/nj2k/testData/newJ2k/comments/fieldsInitializedFromParams.kt b/nj2k/testData/newJ2k/comments/fieldsInitializedFromParams.kt index 0fc94625752..523bf702017 100644 --- a/nj2k/testData/newJ2k/comments/fieldsInitializedFromParams.kt +++ b/nj2k/testData/newJ2k/comments/fieldsInitializedFromParams.kt @@ -1,9 +1,7 @@ -internal class C( -// field p1 - private val p1: Int, /* parameter p1 */ +internal class C(// field p1 + private val p1: Int /* parameter p1 */, /** * Field myP2 */ private val myP2: Int, /* Field p3 */ - var p3: Int -) \ No newline at end of file + var p3: Int) \ No newline at end of file diff --git a/nj2k/testData/newJ2k/constructors/lineBreaksBetweenParameters.kt b/nj2k/testData/newJ2k/constructors/lineBreaksBetweenParameters.kt index 223e264779a..e1fdefe5d0e 100644 --- a/nj2k/testData/newJ2k/constructors/lineBreaksBetweenParameters.kt +++ b/nj2k/testData/newJ2k/constructors/lineBreaksBetweenParameters.kt @@ -1,17 +1,11 @@ -internal class C1( - arg1: Int, - arg2: Int, - arg3: Int -) { - constructor( - x: Int, - y: Int - ) : this(x, x + y, 0) { +internal class C1(arg1: Int, + arg2: Int, + arg3: Int) { + constructor(x: Int, + y: Int) : this(x, x + y, 0) { } } -internal class C2( - private val arg1: Int, - private val arg2: Int, - arg3: Int -) \ No newline at end of file +internal class C2(private val arg1: Int, + private val arg2: Int, + arg3: Int) \ No newline at end of file diff --git a/nj2k/testData/newJ2k/detectProperties/Comments.kt b/nj2k/testData/newJ2k/detectProperties/Comments.kt index 378efaf5905..391e2f649fa 100644 --- a/nj2k/testData/newJ2k/detectProperties/Comments.kt +++ b/nj2k/testData/newJ2k/detectProperties/Comments.kt @@ -1,9 +1,7 @@ -internal class A( -// comment for field2 setter +internal class A(// comment for field2 setter // comment for field2 getter var field2 // comment for field2 - : Int -) { + : Int) { /** * Comment for field1 setter */ diff --git a/nj2k/testData/newJ2k/detectProperties/DataClassWithAnnotations.kt b/nj2k/testData/newJ2k/detectProperties/DataClassWithAnnotations.kt index f00eb3fe7f7..5b813d10987 100644 --- a/nj2k/testData/newJ2k/detectProperties/DataClassWithAnnotations.kt +++ b/nj2k/testData/newJ2k/detectProperties/DataClassWithAnnotations.kt @@ -2,8 +2,6 @@ internal annotation class TestAnnotationField internal annotation class TestAnnotationParam internal annotation class TestAnnotationGet internal annotation class TestAnnotationSet -class Test( - @field:TestAnnotationField @set:TestAnnotationSet - @get:TestAnnotationGet - @param:TestAnnotationParam var arg: String -) \ No newline at end of file +class Test(@field:TestAnnotationField @set:TestAnnotationSet + @get:TestAnnotationGet + @param:TestAnnotationParam var arg: String) \ No newline at end of file diff --git a/nj2k/testData/newJ2k/docComments/deprecatedDocTagWithMultiLineMessage.kt b/nj2k/testData/newJ2k/docComments/deprecatedDocTagWithMultiLineMessage.kt index 3c94f856c2a..f0c221b93bf 100644 --- a/nj2k/testData/newJ2k/docComments/deprecatedDocTagWithMultiLineMessage.kt +++ b/nj2k/testData/newJ2k/docComments/deprecatedDocTagWithMultiLineMessage.kt @@ -1,9 +1,7 @@ -@Deprecated( - """Ph'nglui mglw'nafh +@Deprecated("""Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn. 'In His House at R'lyeh Dead Cthulhu waits dreaming, yet He shall rise and His kingdom - shall cover the Earth.'""" -) + shall cover the Earth.'""") class TestDeprecatedInJavadocWithMultilineMessage \ No newline at end of file diff --git a/nj2k/testData/newJ2k/enum/runnableImplementation.kt b/nj2k/testData/newJ2k/enum/runnableImplementation.kt index 5cb176d088f..099aa79fa68 100644 --- a/nj2k/testData/newJ2k/enum/runnableImplementation.kt +++ b/nj2k/testData/newJ2k/enum/runnableImplementation.kt @@ -2,9 +2,7 @@ internal enum class Color : Runnable { WHITE, BLACK, RED, YELLOW, BLUE; override fun run() { - println( - "name()=" + name + - ", toString()=" + toString() - ) + println("name()=" + name + + ", toString()=" + toString()) } } \ No newline at end of file diff --git a/nj2k/testData/newJ2k/formatting/lineBreaksBetweenArguments.kt b/nj2k/testData/newJ2k/formatting/lineBreaksBetweenArguments.kt index d6dab4f7270..c98620e93de 100644 --- a/nj2k/testData/newJ2k/formatting/lineBreaksBetweenArguments.kt +++ b/nj2k/testData/newJ2k/formatting/lineBreaksBetweenArguments.kt @@ -1,8 +1,7 @@ internal class F { fun f1(p1: Int, p2: Int, p3: Int, p4: Int, vararg p5: Int) {} fun f2(array: IntArray) { - f1( - 1, 2, + f1(1, 2, 3, 4, *array ) diff --git a/nj2k/testData/newJ2k/function/lineBreaksBetweenParameters.kt b/nj2k/testData/newJ2k/function/lineBreaksBetweenParameters.kt index 5fda2669700..f01965d887b 100644 --- a/nj2k/testData/newJ2k/function/lineBreaksBetweenParameters.kt +++ b/nj2k/testData/newJ2k/function/lineBreaksBetweenParameters.kt @@ -2,14 +2,11 @@ internal class C { fun foo1(p1: Int, p2: Int) {} fun foo2( p1: Int, - p2: Int - ) { + p2: Int) { } - fun foo3( - p1: Int, - p2: Int - ) { + fun foo3(p1: Int, + p2: Int) { } fun foo4( diff --git a/nj2k/testData/newJ2k/issues/kt-19569.kt b/nj2k/testData/newJ2k/issues/kt-19569.kt index 191ab3b360d..30f5985f0dc 100644 --- a/nj2k/testData/newJ2k/issues/kt-19569.kt +++ b/nj2k/testData/newJ2k/issues/kt-19569.kt @@ -1,8 +1,6 @@ class TestJavaBoxedPrimitives { - fun foo( - x1: Boolean, x2: Byte, x3: Short, x4: Int, - x5: Long, x6: Float, x7: Double, x8: Char - ): Array { + fun foo(x1: Boolean, x2: Byte, x3: Short, x4: Int, + x5: Long, x6: Float, x7: Double, x8: Char): Array { return arrayOf(x1, x2, x3, x4, x5, x6, x7, x8) } -} \ No newline at end of file +} diff --git a/nj2k/testData/newJ2k/methodCallExpression/stringMethods.kt b/nj2k/testData/newJ2k/methodCallExpression/stringMethods.kt index e1d986f404d..b2a0288b3c5 100644 --- a/nj2k/testData/newJ2k/methodCallExpression/stringMethods.kt +++ b/nj2k/testData/newJ2k/methodCallExpression/stringMethods.kt @@ -66,17 +66,15 @@ internal class A { val s = "test string" s == "test" s.equals( - "tesT", - ignoreCase = true - ) + "tesT" + , ignoreCase = true) s.compareTo("Test", ignoreCase = true) s.regionMatches( 0, "TE", 0, - 2, - ignoreCase = true - ) + 2 + , ignoreCase = true) s.regionMatches(0, "st", 1, 2) s.replace("\\w+".toRegex(), "---") .replaceFirst("([s-t])".toRegex(), "A$1") diff --git a/nj2k/testData/newJ2k/mutableCollections/FunctionParameters.kt b/nj2k/testData/newJ2k/mutableCollections/FunctionParameters.kt index dde9c24226f..2dcc227b239 100644 --- a/nj2k/testData/newJ2k/mutableCollections/FunctionParameters.kt +++ b/nj2k/testData/newJ2k/mutableCollections/FunctionParameters.kt @@ -1,10 +1,8 @@ internal class A { - fun foo( - nonMutableCollection: Collection?, + fun foo(nonMutableCollection: Collection?, mutableCollection: MutableCollection, mutableSet: MutableSet, - mutableMap: MutableMap - ) { + mutableMap: MutableMap) { mutableCollection.addAll(nonMutableCollection!!) mutableSet.add(mutableMap.remove("a")) } diff --git a/nj2k/testData/newJ2k/newClassExpression/lineBreaks.kt b/nj2k/testData/newJ2k/newClassExpression/lineBreaks.kt index 5546ca842fd..0191ba7d5b5 100644 --- a/nj2k/testData/newJ2k/newClassExpression/lineBreaks.kt +++ b/nj2k/testData/newJ2k/newClassExpression/lineBreaks.kt @@ -1,10 +1,8 @@ internal class C(p1: Int, p2: Int, p3: Int) internal class User { fun foo() { - C( - 1, + C(1, 2, - 3 - ) + 3) } } \ No newline at end of file diff --git a/nj2k/testData/newJ2k/objectLiteral/MyFrame.kt b/nj2k/testData/newJ2k/objectLiteral/MyFrame.kt index 5edbeb06619..e0a74722156 100644 --- a/nj2k/testData/newJ2k/objectLiteral/MyFrame.kt +++ b/nj2k/testData/newJ2k/objectLiteral/MyFrame.kt @@ -20,11 +20,9 @@ internal class Client : Frame() { override fun windowClosing() {} } addWindowListener(a) - addWindowListener( - object : WindowAdapter() { - override fun windowClosing() {} - } - ) + addWindowListener(object : WindowAdapter() { + override fun windowClosing() {} + }) val b: EmptyWindowListener = object : EmptyWindowListener {} val c: EmptyWindowAdapter = object : EmptyWindowAdapter() {} } diff --git a/nj2k/testData/newJ2k/returnStatement/currentMethodBug.kt b/nj2k/testData/newJ2k/returnStatement/currentMethodBug.kt index 3987a658d6b..db3f8b48e0b 100644 --- a/nj2k/testData/newJ2k/returnStatement/currentMethodBug.kt +++ b/nj2k/testData/newJ2k/returnStatement/currentMethodBug.kt @@ -5,12 +5,10 @@ internal interface I { internal class C { val `object`: Any? get() { - foo( - object : I { - override val int: Int - get() = 0 - } - ) + foo(object : I { + override val int: Int + get() = 0 + }) return string } diff --git a/nj2k/testData/newJ2k/tryWithResource/WithReturnInAnonymousClass.kt b/nj2k/testData/newJ2k/tryWithResource/WithReturnInAnonymousClass.kt index 1161f88a93a..7b6b05e8a74 100644 --- a/nj2k/testData/newJ2k/tryWithResource/WithReturnInAnonymousClass.kt +++ b/nj2k/testData/newJ2k/tryWithResource/WithReturnInAnonymousClass.kt @@ -11,15 +11,12 @@ class C { @Throws(IOException::class) fun foo() { ByteArrayInputStream(ByteArray(10)).use { stream -> - bar( - object : I { - @Throws(IOException::class) - override fun doIt(stream: InputStream): Int { - return stream.available() - } - }, - stream - ) + bar(object : I { + @Throws(IOException::class) + override fun doIt(stream: InputStream): Int { + return stream.available() + } + }, stream) } } diff --git a/nj2k/testData/newJ2k/tryWithResource/WithReturnInAnonymousClass2.kt b/nj2k/testData/newJ2k/tryWithResource/WithReturnInAnonymousClass2.kt index f80525cf2a3..c03eb1040be 100644 --- a/nj2k/testData/newJ2k/tryWithResource/WithReturnInAnonymousClass2.kt +++ b/nj2k/testData/newJ2k/tryWithResource/WithReturnInAnonymousClass2.kt @@ -11,15 +11,12 @@ class C { @Throws(IOException::class) fun foo(): Int { ByteArrayInputStream(ByteArray(10)).use { stream -> - return bar( - object : I { - @Throws(IOException::class) - override fun doIt(stream: InputStream): Int { - return stream.available() - } - }, - stream - ) + return bar(object : I { + @Throws(IOException::class) + override fun doIt(stream: InputStream): Int { + return stream.available() + } + }, stream) } }