From cffa532896adda7b939afd6be6ff2ae4e9cb334e Mon Sep 17 00:00:00 2001 From: Dmitry Gridin Date: Wed, 6 Apr 2022 18:21:18 +0700 Subject: [PATCH] [kotlin][formatter] migrate `AbstractFormatterTest` to official code style and simplify code GitOrigin-RevId: 522453e1996172e32305aa90d14ec586caca3230 --- .../kotlin/formatter/AbstractFormatterTest.kt | 71 +-- .../testData/formatter/ArrayLiteral.after.kt | 12 +- .../formatter/AssignmentWrap.after.kt | 6 +- .../BinaryExpressionsBoolean.after.inv.kt | 18 +- .../BinaryExpressionsBoolean.after.kt | 12 +- .../BlankLinesAfterClassHeader.after.kt | 2 +- .../BlankLinesAfterClassHeader2.after.kt | 2 +- .../CallLParenthOnNextLine.after.inv.kt | 5 +- .../formatter/CallLParenthOnNextLine.after.kt | 7 +- ...allLParenthOnNextLineAndComma.after.inv.kt | 5 +- .../CallLParenthOnNextLineAndComma.after.kt | 7 +- .../CallRParenthOnNextLine.after.inv.kt | 7 +- .../formatter/CallRParenthOnNextLine.after.kt | 7 +- ...allRParenthOnNextLineAndComma.after.inv.kt | 7 +- .../CallRParenthOnNextLineAndComma.after.kt | 7 +- .../CommentInExpressionBodies.after.kt | 16 +- .../CommentInFunctionLiteral.after.kt | 4 +- .../formatter/DanglingComments.after.kt | 6 +- .../formatter/DelegationList.after.inv.kt | 16 +- .../formatter/DelegationList.after.kt | 6 +- .../testData/formatter/Elvis.after.inv.kt | 8 +- .../formatter/ElvisInStringTemplate.after.kt | 5 +- .../formatter/ElvisIndent.after.inv.kt | 20 +- .../testData/formatter/ElvisIndent.after.kt | 20 +- .../ElvisWithOperationReference.after.kt | 4 +- .../testData/formatter/ElvisWrap.after.kt | 2 +- ...LineBetweeMultilineDeclarationTwo.after.kt | 6 +- ...ineBetweeMultilineDeclarationZero.after.kt | 6 +- .../formatter/EnumInitializerList.after.kt | 6 +- .../formatter/ExpressionBodyWrap.after.kt | 2 +- .../ExtendsListAlignEnum.after.inv.kt | 3 +- .../formatter/ExtendsListAlignEnum.after.kt | 3 +- .../FormatFirstColumnComments.after.inv.kt | 10 +- .../FormatFirstColumnComments.after.kt | 8 +- .../FunctionCallParametersAlign.after.kt | 8 +- .../FunctionDefParametersAlign.after.kt | 8 +- .../formatter/FunctionExpression.after.kt | 10 +- .../formatter/FunctionWithInference.after.kt | 2 +- .../formatter/IfClosingParen.after.kt | 2 +- .../formatter/IfConditionIndent.after.inv.kt | 6 +- .../formatter/IfConditionIndent.after.kt | 6 +- .../LineBreakBeforeExtendsColon.after.kt | 2 +- .../LineBreakBeforeExtendsColonWrap.after.kt | 2 +- .../MethodLParenthOnNextLine.after.inv.kt | 5 +- .../MethodLParenthOnNextLine.after.kt | 7 +- .../MethodRParenthOnNextLine.after.inv.kt | 7 +- .../MethodRParenthOnNextLine.after.kt | 7 +- .../formatter/Multideclaration.after.kt | 14 +- .../formatter/MultilineStringEntry6.after.kt | 4 +- .../formatter/NewLineForRBrace.after.kt | 8 +- .../ParameterAnnotationWrap.after.kt | 12 +- .../formatter/ParameterDocComments.after.kt | 35 +- .../formatter/Parameters.after.inv.kt | 8 +- .../testData/formatter/Parameters.after.kt | 8 +- .../formatter/PrimaryConstructor.after.kt | 10 +- .../formatter/PropertyWithInference.after.kt | 2 +- .../RightBracketOnNewLine.after.inv.kt | 5 +- .../formatter/RightBracketOnNewLine.after.kt | 5 +- ...aceAroundExtendColonInObjects.after.inv.kt | 4 +- .../SpaceAroundExtendColonInObjects.after.kt | 4 +- .../SpacesInQualifiedExpressions.after.kt | 6 +- .../testData/formatter/ValVarSpaces.after.kt | 8 +- .../testData/formatter/WhenComment.after.kt | 6 +- .../testData/formatter/WhereClause.after.kt | 4 +- .../callChain/CallChainWrapping.after.inv.kt | 126 ++--- .../callChain/CallChainWrapping.after.kt | 76 +-- .../callChain/CallChainWrapping2.after.inv.kt | 95 ++-- .../callChain/CallChainWrapping2.after.kt | 92 ++-- .../CallChainWrappingChopDown.after.inv.kt | 38 +- .../CallChainWrappingChopDown.after.kt | 42 +- .../CallChainWrappingInElvis.after.inv.kt | 12 +- .../CallChainWrappingInElvis.after.kt | 8 +- .../callChain/ConsecutiveCalls.after.kt | 6 +- .../ConsecutiveSafeCallsIndent.after.inv.kt | 10 +- .../ConsecutiveSafeCallsIndent.after.kt | 10 +- .../FunctionLiteralsInChainCalls.after.inv.kt | 4 +- .../FunctionLiteralsInChainCalls.after.kt | 4 +- .../formatter/callChain/KT15099.after.kt | 12 +- .../formatter/callChain/KT22071.after.kt | 3 +- .../formatter/callChain/KT37545.after.kt | 180 +++---- .../ArgumentListChopAsNeeded.after.kt | 15 +- .../ArgumentListWrapAlways.after.kt | 18 +- .../ArgumentListWrapAsNeeded.after.kt | 13 +- .../DefaultParameterValues.after.inv.kt | 8 +- .../DefaultParameterValues.after.kt | 8 +- .../ParameterListChopAsNeeded.after.kt | 108 ++-- .../ParameterListWrapAlways.after.kt | 172 +++--- .../ParameterListWrapAsNeeded.after.kt | 111 ++-- ...CollectionLiteralInAnnotation.after.inv.kt | 166 +++--- .../CollectionLiteralInAnnotation.after.kt | 166 +++--- ...ctionLiteralInAnnotation.call.after.inv.kt | 166 +++--- ...ollectionLiteralInAnnotation.call.after.kt | 170 +++--- ...ructuringDeclarationsInLambda.after.inv.kt | 42 +- ...DestructuringDeclarationsInLambda.after.kt | 76 +-- .../MultiVariableDeclaration.after.inv.kt | 36 +- .../MultiVariableDeclaration.after.kt | 52 +- .../trailingComma/enumEntry/Enum.after.inv.kt | 8 +- .../trailingComma/enumEntry/Enum.after.kt | 8 +- .../indices/IndicesAccess.after.inv.kt | 2 +- .../indices/IndicesAccess.after.kt | 2 +- .../indices/IndicesAccess.call.after.inv.kt | 4 +- .../indices/IndicesAccess.call.after.kt | 18 +- .../LambdaParameterList.after.inv.kt | 78 +-- .../LambdaParameterList.after.kt | 114 ++-- .../LambdaParameterList.call.after.inv.kt | 78 +-- .../LambdaParameterList.call.after.kt | 114 ++-- .../TypeArgumentList.after.inv.kt | 4 +- .../typeArguments/TypeArgumentList.after.kt | 4 +- .../TypeArgumentList.call.after.inv.kt | 4 +- .../TypeArgumentList.call.after.kt | 20 +- .../TypeParameterList.after.inv.kt | 10 +- .../typeParameters/TypeParameterList.after.kt | 10 +- .../TypeParameterList.call.after.inv.kt | 10 +- .../TypeParameterList.call.after.kt | 10 +- .../ArgumentListChopAsNeeded.after.inv.kt | 192 ++++--- .../ArgumentListChopAsNeeded.after.kt | 192 ++++--- .../ArgumentListDoNotWrap.after.inv.kt | 192 ++++--- .../ArgumentListDoNotWrap.after.kt | 192 ++++--- .../ArgumentListWrapAlways.after.inv.kt | 490 ++++++++++-------- .../ArgumentListWrapAlways.after.kt | 490 ++++++++++-------- .../ArgumentListWrapAsNeeded.after.inv.kt | 192 ++++--- .../ArgumentListWrapAsNeeded.after.kt | 192 ++++--- ...ArgumentListWrapAsNeeded.call.after.inv.kt | 192 ++++--- .../ArgumentListWrapAsNeeded.call.after.kt | 330 ++++++------ .../NamedArguments.after.inv.kt | 34 +- .../valueArguments/NamedArguments.after.kt | 34 +- .../LambdaValueParameters.after.inv.kt | 57 +- .../LambdaValueParameters.after.kt | 42 +- .../NamedParameters.after.inv.kt | 12 +- .../valueParameters/NamedParameters.after.kt | 6 +- .../ParameterListChopAsNeeded.after.inv.kt | 291 +++++------ .../ParameterListChopAsNeeded.after.kt | 304 +++++------ .../ParameterListDoNotWrap.after.inv.kt | 291 +++++------ .../ParameterListDoNotWrap.after.kt | 304 +++++------ .../ParameterListWrapAlways.after.inv.kt | 343 ++++++------ .../ParameterListWrapAlways.after.kt | 348 ++++++------- .../ParameterListWrapAsNeeded.after.inv.kt | 291 +++++------ .../ParameterListWrapAsNeeded.after.kt | 304 +++++------ ...arameterListWrapAsNeeded.call.after.inv.kt | 291 +++++------ .../ParameterListWrapAsNeeded.call.after.kt | 304 +++++------ 140 files changed, 4752 insertions(+), 4242 deletions(-) diff --git a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/formatter/AbstractFormatterTest.kt b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/formatter/AbstractFormatterTest.kt index 4e6020e5498c..6203e0e2500f 100644 --- a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/formatter/AbstractFormatterTest.kt +++ b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/formatter/AbstractFormatterTest.kt @@ -2,78 +2,18 @@ package org.jetbrains.kotlin.formatter import com.intellij.application.options.CodeStyle -import com.intellij.openapi.roots.LanguageLevelProjectExtension import com.intellij.openapi.util.io.FileUtil -import com.intellij.pom.java.LanguageLevel -import com.intellij.psi.PsiDocumentManager -import com.intellij.psi.PsiFile import com.intellij.psi.codeStyle.CodeStyleManager -import com.intellij.testFramework.LightIdeaTestCase -import com.intellij.util.IncorrectOperationException -import org.jetbrains.annotations.NonNls import org.jetbrains.kotlin.idea.KotlinLanguage import org.jetbrains.kotlin.idea.formatter.kotlinCustomSettings import org.jetbrains.kotlin.idea.test.InTextDirectivesUtils +import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase import org.jetbrains.kotlin.idea.test.KotlinTestUtils import org.jetbrains.kotlin.idea.test.configureCodeStyleAndRun import org.jetbrains.kotlin.idea.util.application.executeWriteCommand import java.io.File -// Based on from com.intellij.psi.formatter.java.AbstractJavaFormatterTest -abstract class AbstractFormatterTest : LightIdeaTestCase() { - enum class Action { - REFORMAT, INDENT - } - - private interface TestFormatAction { - fun run(psiFile: PsiFile, startOffset: Int, endOffset: Int) - } - - companion object { - private val ACTIONS: Map = mapOf( - Action.REFORMAT to object : TestFormatAction { - override fun run(psiFile: PsiFile, startOffset: Int, endOffset: Int) { - CodeStyleManager.getInstance(psiFile.project).reformatText(psiFile, startOffset, endOffset) - } - }, - - Action.INDENT to object : TestFormatAction { - override fun run(psiFile: PsiFile, startOffset: Int, endOffset: Int) { - CodeStyleManager.getInstance(psiFile.project).adjustLineIndent(psiFile, startOffset) - } - }, - ) - } - - override fun setUp() { - super.setUp() - LanguageLevelProjectExtension.getInstance(project).languageLevel = LanguageLevel.HIGHEST - } - - fun doTextTest(@NonNls text: String, fileAfter: File?, extension: String) { - doTextTest(Action.REFORMAT, text, fileAfter, extension) - } - - fun doTextTest(action: Action, text: String, fileAfter: File?, extension: String) { - val file = createFile("A$extension", text) - val manager = PsiDocumentManager.getInstance(project) - val document = manager.getDocument(file) ?: error("Don't expect the document to be null") - project.executeWriteCommand("") { - document.replaceString(0, document.textLength, text) - manager.commitDocument(document) - try { - val rangeToUse = file.textRange - ACTIONS[action]?.run(file, rangeToUse.startOffset, rangeToUse.endOffset) - } catch (e: IncorrectOperationException) { - fail(e.localizedMessage) - } - } - - KotlinTestUtils.assertEqualsToFile(fileAfter!!, document.text) - manager.commitDocument(document) - KotlinTestUtils.assertEqualsToFile(fileAfter, file.text) - } - +abstract class AbstractFormatterTest : KotlinLightCodeInsightFixtureTestCase() { fun doTestInverted(expectedFileNameWithExtension: String) { doTest(expectedFileNameWithExtension, true, false) } @@ -94,6 +34,7 @@ abstract class AbstractFormatterTest : LightIdeaTestCase() { val testFileExtension = ".${file.extension}" val originalFile = File(file.parent, testFileName + testFileExtension) val originalFileText = FileUtil.loadFile(originalFile, true) + val psiFile = myFixture.configureByText("A$testFileExtension", originalFileText) configureCodeStyleAndRun(project) { val codeStyleSettings = CodeStyle.getSettings(project) @@ -116,7 +57,11 @@ abstract class AbstractFormatterTest : LightIdeaTestCase() { } customSettings.ALLOW_TRAILING_COMMA_ON_CALL_SITE = callSite - doTextTest(originalFileText, file, testFileExtension) + project.executeWriteCommand("reformat") { + CodeStyleManager.getInstance(project).reformat(psiFile) + } + + KotlinTestUtils.assertEqualsToFile(file, psiFile.text) } } } \ No newline at end of file diff --git a/plugins/kotlin/idea/tests/testData/formatter/ArrayLiteral.after.kt b/plugins/kotlin/idea/tests/testData/formatter/ArrayLiteral.after.kt index 18ccaa0af76a..f605b7746c68 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/ArrayLiteral.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/ArrayLiteral.after.kt @@ -1,7 +1,7 @@ @Component( - modules = [ - AppModule::class, - DataModule::class, - DomainModule::class - ] -) \ No newline at end of file + modules = [ + AppModule::class, + DataModule::class, + DomainModule::class + ] +) diff --git a/plugins/kotlin/idea/tests/testData/formatter/AssignmentWrap.after.kt b/plugins/kotlin/idea/tests/testData/formatter/AssignmentWrap.after.kt index 3d80d0534b2d..c053376e9bcf 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/AssignmentWrap.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/AssignmentWrap.after.kt @@ -1,11 +1,11 @@ val x = - 1 + 1 fun foo() { val y = - 2 + 2 y = - 3 + 3 } // SET_INT: ASSIGNMENT_WRAP = 2 diff --git a/plugins/kotlin/idea/tests/testData/formatter/BinaryExpressionsBoolean.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/BinaryExpressionsBoolean.after.inv.kt index 6d6a9656c72e..8ca6f8f9bf6b 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/BinaryExpressionsBoolean.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/BinaryExpressionsBoolean.after.inv.kt @@ -1,24 +1,28 @@ fun test() { if (true - || false - || true) { + || false + || true + ) { } if (true || false - || true) { + || true + ) { } if (true - || false - || true) { + || false + || true + ) { } if (true || - false || - true) { + false || + true + ) { } diff --git a/plugins/kotlin/idea/tests/testData/formatter/BinaryExpressionsBoolean.after.kt b/plugins/kotlin/idea/tests/testData/formatter/BinaryExpressionsBoolean.after.kt index dd5d40f56bcb..8b7e36f25c59 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/BinaryExpressionsBoolean.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/BinaryExpressionsBoolean.after.kt @@ -1,24 +1,28 @@ fun test() { if (true || false - || true) { + || true + ) { } if (true || false - || true) { + || true + ) { } if (true || false - || true) { + || true + ) { } if (true || false || - true) { + true + ) { } diff --git a/plugins/kotlin/idea/tests/testData/formatter/BlankLinesAfterClassHeader.after.kt b/plugins/kotlin/idea/tests/testData/formatter/BlankLinesAfterClassHeader.after.kt index 62634f017500..c6cec5372f65 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/BlankLinesAfterClassHeader.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/BlankLinesAfterClassHeader.after.kt @@ -42,7 +42,7 @@ class FooN : IFoo { } class FooC( - val x: String + val x: String ) { fun bar() diff --git a/plugins/kotlin/idea/tests/testData/formatter/BlankLinesAfterClassHeader2.after.kt b/plugins/kotlin/idea/tests/testData/formatter/BlankLinesAfterClassHeader2.after.kt index 3f5135e6c13f..aa6053acc718 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/BlankLinesAfterClassHeader2.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/BlankLinesAfterClassHeader2.after.kt @@ -49,7 +49,7 @@ class FooN : IFoo { } class FooC( - val x: String + val x: String ) { diff --git a/plugins/kotlin/idea/tests/testData/formatter/CallLParenthOnNextLine.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/CallLParenthOnNextLine.after.inv.kt index 174743ae9355..455e9ae2497a 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/CallLParenthOnNextLine.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/CallLParenthOnNextLine.after.inv.kt @@ -1,5 +1,6 @@ val x = foo("a", - "b") + "b" +) // SET_TRUE: CALL_PARAMETERS_LPAREN_ON_NEXT_LINE -// TRAILING_COMMA: false \ No newline at end of file +// TRAILING_COMMA: false diff --git a/plugins/kotlin/idea/tests/testData/formatter/CallLParenthOnNextLine.after.kt b/plugins/kotlin/idea/tests/testData/formatter/CallLParenthOnNextLine.after.kt index 2b2438d57594..229b8fd1bcce 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/CallLParenthOnNextLine.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/CallLParenthOnNextLine.after.kt @@ -1,6 +1,7 @@ val x = foo( - "a", - "b") + "a", + "b" +) // SET_TRUE: CALL_PARAMETERS_LPAREN_ON_NEXT_LINE -// TRAILING_COMMA: false \ No newline at end of file +// TRAILING_COMMA: false diff --git a/plugins/kotlin/idea/tests/testData/formatter/CallLParenthOnNextLineAndComma.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/CallLParenthOnNextLineAndComma.after.inv.kt index 118e0334aa56..424132ce2515 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/CallLParenthOnNextLineAndComma.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/CallLParenthOnNextLineAndComma.after.inv.kt @@ -1,5 +1,6 @@ val x = foo("a", - "b") + "b" +) // SET_TRUE: CALL_PARAMETERS_LPAREN_ON_NEXT_LINE -// TRAILING_COMMA: true \ No newline at end of file +// TRAILING_COMMA: true diff --git a/plugins/kotlin/idea/tests/testData/formatter/CallLParenthOnNextLineAndComma.after.kt b/plugins/kotlin/idea/tests/testData/formatter/CallLParenthOnNextLineAndComma.after.kt index c0cf6fc22523..cf58e993f71d 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/CallLParenthOnNextLineAndComma.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/CallLParenthOnNextLineAndComma.after.kt @@ -1,6 +1,7 @@ val x = foo( - "a", - "b") + "a", + "b" +) // SET_TRUE: CALL_PARAMETERS_LPAREN_ON_NEXT_LINE -// TRAILING_COMMA: true \ No newline at end of file +// TRAILING_COMMA: true diff --git a/plugins/kotlin/idea/tests/testData/formatter/CallRParenthOnNextLine.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/CallRParenthOnNextLine.after.inv.kt index 0729be268744..dfecb040cfa3 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/CallRParenthOnNextLine.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/CallRParenthOnNextLine.after.inv.kt @@ -1,5 +1,6 @@ -val x = foo("a", - "b") +val x = foo( + "a", + "b") // SET_TRUE: CALL_PARAMETERS_RPAREN_ON_NEXT_LINE -// TRAILING_COMMA: false \ No newline at end of file +// TRAILING_COMMA: false diff --git a/plugins/kotlin/idea/tests/testData/formatter/CallRParenthOnNextLine.after.kt b/plugins/kotlin/idea/tests/testData/formatter/CallRParenthOnNextLine.after.kt index 479920878368..06de0fbeb5dd 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/CallRParenthOnNextLine.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/CallRParenthOnNextLine.after.kt @@ -1,6 +1,7 @@ -val x = foo("a", - "b" +val x = foo( + "a", + "b" ) // SET_TRUE: CALL_PARAMETERS_RPAREN_ON_NEXT_LINE -// TRAILING_COMMA: false \ No newline at end of file +// TRAILING_COMMA: false diff --git a/plugins/kotlin/idea/tests/testData/formatter/CallRParenthOnNextLineAndComma.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/CallRParenthOnNextLineAndComma.after.inv.kt index 1c6db48023f6..3b382e6172c8 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/CallRParenthOnNextLineAndComma.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/CallRParenthOnNextLineAndComma.after.inv.kt @@ -1,5 +1,6 @@ -val x = foo("a", - "b") +val x = foo( + "a", + "b") // SET_TRUE: CALL_PARAMETERS_RPAREN_ON_NEXT_LINE -// TRAILING_COMMA: true \ No newline at end of file +// TRAILING_COMMA: true diff --git a/plugins/kotlin/idea/tests/testData/formatter/CallRParenthOnNextLineAndComma.after.kt b/plugins/kotlin/idea/tests/testData/formatter/CallRParenthOnNextLineAndComma.after.kt index 156b11fa942f..1e6a6d81205f 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/CallRParenthOnNextLineAndComma.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/CallRParenthOnNextLineAndComma.after.kt @@ -1,6 +1,7 @@ -val x = foo("a", - "b" +val x = foo( + "a", + "b" ) // SET_TRUE: CALL_PARAMETERS_RPAREN_ON_NEXT_LINE -// TRAILING_COMMA: true \ No newline at end of file +// TRAILING_COMMA: true diff --git a/plugins/kotlin/idea/tests/testData/formatter/CommentInExpressionBodies.after.kt b/plugins/kotlin/idea/tests/testData/formatter/CommentInExpressionBodies.after.kt index e305c93b3617..acf4d5c3dc3e 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/CommentInExpressionBodies.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/CommentInExpressionBodies.after.kt @@ -1,17 +1,17 @@ fun foo() = - // comment - 1 + // comment + 1 val some = - // Comment - 2 + // Comment + 2 fun some() { val (a, b) = - // Some - 1 to 3 + // Some + 1 to 3 } fun nice() = - /* Ha! */ - 2 \ No newline at end of file + /* Ha! */ + 2 diff --git a/plugins/kotlin/idea/tests/testData/formatter/CommentInFunctionLiteral.after.kt b/plugins/kotlin/idea/tests/testData/formatter/CommentInFunctionLiteral.after.kt index a86b5cd16a2a..03e13f1c2f0e 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/CommentInFunctionLiteral.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/CommentInFunctionLiteral.after.kt @@ -19,8 +19,8 @@ fun foo() { test() { /* - val a = 42 - */ + val a = 42 + */ } test() { diff --git a/plugins/kotlin/idea/tests/testData/formatter/DanglingComments.after.kt b/plugins/kotlin/idea/tests/testData/formatter/DanglingComments.after.kt index 30aa7cf657af..11126d66932a 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/DanglingComments.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/DanglingComments.after.kt @@ -1,8 +1,8 @@ fun x1() = // cx1 - 42 + 42 fun x2() = /* cx2 */ - 42 + 42 fun x3() { 1 + // cx4_1 @@ -10,4 +10,4 @@ fun x3() { 1 + /* cx4_2 */ 2 -} \ No newline at end of file +} diff --git a/plugins/kotlin/idea/tests/testData/formatter/DelegationList.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/DelegationList.after.inv.kt index a02ff1fc36a4..02f9c11933c2 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/DelegationList.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/DelegationList.after.inv.kt @@ -5,23 +5,23 @@ interface A3 open class B1 class Simpleclass1() : B1(), A1, - A2, A3 + A2, A3 class SimpleClass2() : - B1(), A1, - A2, A3 + B1(), A1, + A2, A3 class Temp { class SimpleClass3() : B1(), A1, - A2, A3 + A2, A3 } object SimpleObject1 : B1(), A1, - A2, A3 + A2, A3 object SimpleObject2 : B1(), - A1, - A2, A3 + A1, + A2, A3 open class C1 open class C2 @@ -31,4 +31,4 @@ enum class Test : A1 { SECOND_ITEM() } -// SET_TRUE: ALIGN_MULTILINE_EXTENDS_LIST \ No newline at end of file +// SET_TRUE: ALIGN_MULTILINE_EXTENDS_LIST diff --git a/plugins/kotlin/idea/tests/testData/formatter/DelegationList.after.kt b/plugins/kotlin/idea/tests/testData/formatter/DelegationList.after.kt index ec88d6863417..e45eebfc46a2 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/DelegationList.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/DelegationList.after.kt @@ -8,8 +8,8 @@ class Simpleclass1() : B1(), A1, A2, A3 class SimpleClass2() : - B1(), A1, - A2, A3 + B1(), A1, + A2, A3 class Temp { class SimpleClass3() : B1(), A1, @@ -31,4 +31,4 @@ enum class Test : A1 { SECOND_ITEM() } -// SET_TRUE: ALIGN_MULTILINE_EXTENDS_LIST \ No newline at end of file +// SET_TRUE: ALIGN_MULTILINE_EXTENDS_LIST diff --git a/plugins/kotlin/idea/tests/testData/formatter/Elvis.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/Elvis.after.inv.kt index 1c517f85adb1..a6d3b790e308 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/Elvis.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/Elvis.after.inv.kt @@ -6,11 +6,11 @@ fun test(a: Int?) { a ?: 42 a - ?: 42 + ?: 42 val some = a - ?: b - ?: 12 + ?: b + ?: 12 } -// SET_TRUE: ALIGN_MULTILINE_BINARY_OPERATION \ No newline at end of file +// SET_TRUE: ALIGN_MULTILINE_BINARY_OPERATION diff --git a/plugins/kotlin/idea/tests/testData/formatter/ElvisInStringTemplate.after.kt b/plugins/kotlin/idea/tests/testData/formatter/ElvisInStringTemplate.after.kt index cd3d1f288ea9..067076ce655d 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/ElvisInStringTemplate.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/ElvisInStringTemplate.after.kt @@ -1,6 +1,7 @@ fun test() { val projectExtId: String? = "id" - val s = "https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:${projectExtId ?: "Kotlin_dev_Compiler"})" + val s = + "https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:${projectExtId ?: "Kotlin_dev_Compiler"})" } -// SET_INT: WRAP_ELVIS_EXPRESSIONS = 2 \ No newline at end of file +// SET_INT: WRAP_ELVIS_EXPRESSIONS = 2 diff --git a/plugins/kotlin/idea/tests/testData/formatter/ElvisIndent.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/ElvisIndent.after.inv.kt index 5c7f185b0521..a7f78ce25b0d 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/ElvisIndent.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/ElvisIndent.after.inv.kt @@ -1,13 +1,17 @@ fun foo() { val topLevelDeclaration = - DescriptorUtils.getParentOfType(referencedDescriptor, PropertyDescriptor::class.java, false) as DeclarationDescriptor? - ?: DescriptorUtils.getParentOfType( - referencedDescriptor, - TypeAliasConstructorDescriptor::class.java, - false - )?.typeAliasDescriptor - ?: DescriptorUtils.getParentOfType(referencedDescriptor, FunctionDescriptor::class.java, false) - ?: return emptyList() + DescriptorUtils.getParentOfType( + referencedDescriptor, + PropertyDescriptor::class.java, + false + ) as DeclarationDescriptor? + ?: DescriptorUtils.getParentOfType( + referencedDescriptor, + TypeAliasConstructorDescriptor::class.java, + false + )?.typeAliasDescriptor + ?: DescriptorUtils.getParentOfType(referencedDescriptor, FunctionDescriptor::class.java, false) + ?: return emptyList() } // SET_FALSE: CONTINUATION_INDENT_IN_ARGUMENT_LISTS diff --git a/plugins/kotlin/idea/tests/testData/formatter/ElvisIndent.after.kt b/plugins/kotlin/idea/tests/testData/formatter/ElvisIndent.after.kt index eceec5730d89..962c43945df2 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/ElvisIndent.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/ElvisIndent.after.kt @@ -1,13 +1,17 @@ fun foo() { val topLevelDeclaration = - DescriptorUtils.getParentOfType(referencedDescriptor, PropertyDescriptor::class.java, false) as DeclarationDescriptor? - ?: DescriptorUtils.getParentOfType( - referencedDescriptor, - TypeAliasConstructorDescriptor::class.java, - false - )?.typeAliasDescriptor - ?: DescriptorUtils.getParentOfType(referencedDescriptor, FunctionDescriptor::class.java, false) - ?: return emptyList() + DescriptorUtils.getParentOfType( + referencedDescriptor, + PropertyDescriptor::class.java, + false + ) as DeclarationDescriptor? + ?: DescriptorUtils.getParentOfType( + referencedDescriptor, + TypeAliasConstructorDescriptor::class.java, + false + )?.typeAliasDescriptor + ?: DescriptorUtils.getParentOfType(referencedDescriptor, FunctionDescriptor::class.java, false) + ?: return emptyList() } // SET_FALSE: CONTINUATION_INDENT_IN_ARGUMENT_LISTS diff --git a/plugins/kotlin/idea/tests/testData/formatter/ElvisWithOperationReference.after.kt b/plugins/kotlin/idea/tests/testData/formatter/ElvisWithOperationReference.after.kt index e307ee1a85fd..6ac48bac1163 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/ElvisWithOperationReference.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/ElvisWithOperationReference.after.kt @@ -2,9 +2,9 @@ infix fun String.concat(other: String): String = this fun binaryContext(anchor: String?) { val v1 = "1234567890... add many chars ...1234567890" concat "b" val v2 = anchor - ?: "1234567890... add many chars ...1234567890" concat "b" + ?: "1234567890... add many chars ...1234567890" concat "b" val v3 = anchor - ?: "1234567890... add many chars ...1234567890" concat "1234567890... add many chars ...1234567890" concat "1234567890... add many chars ...1234567890" concat "b" + ?: "1234567890... add many chars ...1234567890" concat "1234567890... add many chars ...1234567890" concat "1234567890... add many chars ...1234567890" concat "b" } // SET_INT: WRAP_ELVIS_EXPRESSIONS = 2 diff --git a/plugins/kotlin/idea/tests/testData/formatter/ElvisWrap.after.kt b/plugins/kotlin/idea/tests/testData/formatter/ElvisWrap.after.kt index 2de25ba06c1b..30fb49ae9e8a 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/ElvisWrap.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/ElvisWrap.after.kt @@ -1,4 +1,4 @@ val x = "abc" - ?: "def" + ?: "def" // SET_INT: WRAP_ELVIS_EXPRESSIONS = 2 diff --git a/plugins/kotlin/idea/tests/testData/formatter/EmptyLineBetweeMultilineDeclarationTwo.after.kt b/plugins/kotlin/idea/tests/testData/formatter/EmptyLineBetweeMultilineDeclarationTwo.after.kt index 8ea5091f0894..669b1b1d5656 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/EmptyLineBetweeMultilineDeclarationTwo.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/EmptyLineBetweeMultilineDeclarationTwo.after.kt @@ -35,7 +35,7 @@ interface Some2 { @Ann( - 42 + 42 ) fun f6() fun f7() @@ -341,7 +341,7 @@ class Some(b: Boolean) { @Ann( - 42 + 42 ) constructor(b: String) : this(b.isEmpty()) constructor(b: Long) : this(b == 0L) @@ -373,4 +373,4 @@ class Foo { override lateinit var configBridge: ConfigBridge } -// SET_INT: BLANK_LINES_BEFORE_DECLARATION_WITH_COMMENT_OR_ANNOTATION_ON_SEPARATE_LINE = 2 \ No newline at end of file +// SET_INT: BLANK_LINES_BEFORE_DECLARATION_WITH_COMMENT_OR_ANNOTATION_ON_SEPARATE_LINE = 2 diff --git a/plugins/kotlin/idea/tests/testData/formatter/EmptyLineBetweeMultilineDeclarationZero.after.kt b/plugins/kotlin/idea/tests/testData/formatter/EmptyLineBetweeMultilineDeclarationZero.after.kt index e9d9b2765879..d57f33a728c1 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/EmptyLineBetweeMultilineDeclarationZero.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/EmptyLineBetweeMultilineDeclarationZero.after.kt @@ -25,7 +25,7 @@ interface Some2 { @Ann fun f5() @Ann( - 42 + 42 ) fun f6() fun f7() @@ -308,7 +308,7 @@ class Some(b: Boolean) { @Ann constructor(b: Int) : this(b == 0) @Ann( - 42 + 42 ) constructor(b: String) : this(b.isEmpty()) constructor(b: Long) : this(b == 0L) @@ -332,4 +332,4 @@ class Foo { override lateinit var configBridge: ConfigBridge } -// SET_INT: BLANK_LINES_BEFORE_DECLARATION_WITH_COMMENT_OR_ANNOTATION_ON_SEPARATE_LINE = 0 \ No newline at end of file +// SET_INT: BLANK_LINES_BEFORE_DECLARATION_WITH_COMMENT_OR_ANNOTATION_ON_SEPARATE_LINE = 0 diff --git a/plugins/kotlin/idea/tests/testData/formatter/EnumInitializerList.after.kt b/plugins/kotlin/idea/tests/testData/formatter/EnumInitializerList.after.kt index 4b626eb6b893..c714e5a71e8c 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/EnumInitializerList.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/EnumInitializerList.after.kt @@ -2,7 +2,7 @@ package test enum class EnumTest(val value: Int) { VALUE_1 - ( - value = 0 + ( + value = 0 ) -} \ No newline at end of file +} diff --git a/plugins/kotlin/idea/tests/testData/formatter/ExpressionBodyWrap.after.kt b/plugins/kotlin/idea/tests/testData/formatter/ExpressionBodyWrap.after.kt index e2156b5bffa9..092bc69de137 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/ExpressionBodyWrap.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/ExpressionBodyWrap.after.kt @@ -1,4 +1,4 @@ fun foo() = - "abc" + "abc" // SET_INT: WRAP_EXPRESSION_BODY_FUNCTIONS = 2 diff --git a/plugins/kotlin/idea/tests/testData/formatter/ExtendsListAlignEnum.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/ExtendsListAlignEnum.after.inv.kt index 40f31a1ba3ce..f2a32d303abd 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/ExtendsListAlignEnum.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/ExtendsListAlignEnum.after.inv.kt @@ -2,7 +2,6 @@ enum class EnumTest(val value: Int) { VALUE_1( - value = 0 + value = 0 ) } - diff --git a/plugins/kotlin/idea/tests/testData/formatter/ExtendsListAlignEnum.after.kt b/plugins/kotlin/idea/tests/testData/formatter/ExtendsListAlignEnum.after.kt index 40f31a1ba3ce..f2a32d303abd 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/ExtendsListAlignEnum.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/ExtendsListAlignEnum.after.kt @@ -2,7 +2,6 @@ enum class EnumTest(val value: Int) { VALUE_1( - value = 0 + value = 0 ) } - diff --git a/plugins/kotlin/idea/tests/testData/formatter/FormatFirstColumnComments.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/FormatFirstColumnComments.after.inv.kt index 33688909a4b2..a217e280049a 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/FormatFirstColumnComments.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/FormatFirstColumnComments.after.inv.kt @@ -32,15 +32,15 @@ class KDocComments { class MultilineComments { fun test() { /* - * Should not be formatted - */ + * Should not be formatted + */ /* - * Format - */ + * Format + */ /* * Normal */ } } -// SET_TRUE: KEEP_FIRST_COLUMN_COMMENT \ No newline at end of file +// SET_TRUE: KEEP_FIRST_COLUMN_COMMENT diff --git a/plugins/kotlin/idea/tests/testData/formatter/FormatFirstColumnComments.after.kt b/plugins/kotlin/idea/tests/testData/formatter/FormatFirstColumnComments.after.kt index 5bccaad79da3..1c079ba98073 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/FormatFirstColumnComments.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/FormatFirstColumnComments.after.kt @@ -32,11 +32,11 @@ class KDocComments { class MultilineComments { fun test() { /* - * Should not be formatted - */ + * Should not be formatted + */ /* - * Format - */ + * Format + */ /* * Normal */ diff --git a/plugins/kotlin/idea/tests/testData/formatter/FunctionCallParametersAlign.after.kt b/plugins/kotlin/idea/tests/testData/formatter/FunctionCallParametersAlign.after.kt index 9d49208c08ce..069bc4f5f8f1 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/FunctionCallParametersAlign.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/FunctionCallParametersAlign.after.kt @@ -1,6 +1,8 @@ fun test() { - someTestLong(12, - 13) + someTestLong( + 12, + 13 + ) } -// SET_TRUE: ALIGN_MULTILINE_PARAMETERS_IN_CALLS \ No newline at end of file +// SET_TRUE: ALIGN_MULTILINE_PARAMETERS_IN_CALLS diff --git a/plugins/kotlin/idea/tests/testData/formatter/FunctionDefParametersAlign.after.kt b/plugins/kotlin/idea/tests/testData/formatter/FunctionDefParametersAlign.after.kt index 8cddf45699ad..763e181356b1 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/FunctionDefParametersAlign.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/FunctionDefParametersAlign.after.kt @@ -1,5 +1,7 @@ -fun test(a: Int, - b: Int) { +fun test( + a: Int, + b: Int +) { } -// TRAILING_COMMA: false \ No newline at end of file +// TRAILING_COMMA: false diff --git a/plugins/kotlin/idea/tests/testData/formatter/FunctionExpression.after.kt b/plugins/kotlin/idea/tests/testData/formatter/FunctionExpression.after.kt index 3ee4ddcb10f2..b08bed5d9d3b 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/FunctionExpression.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/FunctionExpression.after.kt @@ -5,7 +5,7 @@ val c = fun() {} val c = fun() = 4 val c = fun() = - 4 + 4 val c = fun() {} val c = fun() = 4 @@ -28,8 +28,10 @@ fun test() { test(fun test() = 4) } -fun d = fun(a: Int, - b: String) { +fun d = fun( + a: Int, + b: String +) { } fun e = fun() { @@ -40,4 +42,4 @@ fun f = fun() { foo() } val g: (String) -> Int = fun(p: String): Unit { /* comment */ /* other comment */ } -fun foo() {} \ No newline at end of file +fun foo() {} diff --git a/plugins/kotlin/idea/tests/testData/formatter/FunctionWithInference.after.kt b/plugins/kotlin/idea/tests/testData/formatter/FunctionWithInference.after.kt index bcd8f70bd01e..3f3898b8a410 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/FunctionWithInference.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/FunctionWithInference.after.kt @@ -1,3 +1,3 @@ fun test() = - 12 + 12 diff --git a/plugins/kotlin/idea/tests/testData/formatter/IfClosingParen.after.kt b/plugins/kotlin/idea/tests/testData/formatter/IfClosingParen.after.kt index 4afa1ea3be32..d247534b22fd 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/IfClosingParen.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/IfClosingParen.after.kt @@ -1,6 +1,6 @@ fun foo() { if (longCond1 && - longCond2 + longCond2 ) { } } diff --git a/plugins/kotlin/idea/tests/testData/formatter/IfConditionIndent.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/IfConditionIndent.after.inv.kt index 0c3c2e061f52..ad9e19c9586a 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/IfConditionIndent.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/IfConditionIndent.after.inv.kt @@ -1,7 +1,8 @@ fun foo() { if ("abc" > "def" && "qqq" < "bbb" && - "ddd" > "efg") { + "ddd" > "efg" + ) { println("foo") } } @@ -10,7 +11,8 @@ fun foo() { if ( "abc" > "def" && "qqq" < "bbb" && - "ddd" > "efg") { + "ddd" > "efg" + ) { println("foo") } } diff --git a/plugins/kotlin/idea/tests/testData/formatter/IfConditionIndent.after.kt b/plugins/kotlin/idea/tests/testData/formatter/IfConditionIndent.after.kt index aa67cbe37140..2702fd2eec93 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/IfConditionIndent.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/IfConditionIndent.after.kt @@ -1,7 +1,8 @@ fun foo() { if ("abc" > "def" && "qqq" < "bbb" && - "ddd" > "efg") { + "ddd" > "efg" + ) { println("foo") } } @@ -10,7 +11,8 @@ fun foo() { if ( "abc" > "def" && "qqq" < "bbb" && - "ddd" > "efg") { + "ddd" > "efg" + ) { println("foo") } } diff --git a/plugins/kotlin/idea/tests/testData/formatter/LineBreakBeforeExtendsColon.after.kt b/plugins/kotlin/idea/tests/testData/formatter/LineBreakBeforeExtendsColon.after.kt index e1724d793bad..a5e596d49a56 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/LineBreakBeforeExtendsColon.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/LineBreakBeforeExtendsColon.after.kt @@ -1,4 +1,4 @@ open class GFMOutputBuilder( - to: StringBuilder + to: StringBuilder ) : MarkdownOutputBuilder(to) { } diff --git a/plugins/kotlin/idea/tests/testData/formatter/LineBreakBeforeExtendsColonWrap.after.kt b/plugins/kotlin/idea/tests/testData/formatter/LineBreakBeforeExtendsColonWrap.after.kt index d119bee20879..c8d38c904c84 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/LineBreakBeforeExtendsColonWrap.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/LineBreakBeforeExtendsColonWrap.after.kt @@ -1,5 +1,5 @@ open class GFMOutputBuilder( - to: StringBuilder + to: StringBuilder ) : MarkdownOutputBuilder(to) { } diff --git a/plugins/kotlin/idea/tests/testData/formatter/MethodLParenthOnNextLine.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/MethodLParenthOnNextLine.after.inv.kt index e3d1d7fd3ed6..f0a461bec2e3 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/MethodLParenthOnNextLine.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/MethodLParenthOnNextLine.after.inv.kt @@ -1,5 +1,6 @@ fun foo(a: String, - b: String) + b: String +) // SET_TRUE: METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE -// TRAILING_COMMA: false \ No newline at end of file +// TRAILING_COMMA: false diff --git a/plugins/kotlin/idea/tests/testData/formatter/MethodLParenthOnNextLine.after.kt b/plugins/kotlin/idea/tests/testData/formatter/MethodLParenthOnNextLine.after.kt index fead31e2336a..eb1df431bd2e 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/MethodLParenthOnNextLine.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/MethodLParenthOnNextLine.after.kt @@ -1,6 +1,7 @@ fun foo( - a: String, - b: String) + a: String, + b: String +) // SET_TRUE: METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE -// TRAILING_COMMA: false \ No newline at end of file +// TRAILING_COMMA: false diff --git a/plugins/kotlin/idea/tests/testData/formatter/MethodRParenthOnNextLine.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/MethodRParenthOnNextLine.after.inv.kt index ec482886d254..952039410259 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/MethodRParenthOnNextLine.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/MethodRParenthOnNextLine.after.inv.kt @@ -1,5 +1,6 @@ -fun foo(a: String, - b: String) +fun foo( + a: String, + b: String) // SET_TRUE: METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE -// TRAILING_COMMA: false \ No newline at end of file +// TRAILING_COMMA: false diff --git a/plugins/kotlin/idea/tests/testData/formatter/MethodRParenthOnNextLine.after.kt b/plugins/kotlin/idea/tests/testData/formatter/MethodRParenthOnNextLine.after.kt index 40630933e33f..ab63cac94df1 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/MethodRParenthOnNextLine.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/MethodRParenthOnNextLine.after.kt @@ -1,6 +1,7 @@ -fun foo(a: String, - b: String +fun foo( + a: String, + b: String ) // SET_TRUE: METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE -// TRAILING_COMMA: false \ No newline at end of file +// TRAILING_COMMA: false diff --git a/plugins/kotlin/idea/tests/testData/formatter/Multideclaration.after.kt b/plugins/kotlin/idea/tests/testData/formatter/Multideclaration.after.kt index d2bbf5afaff8..e08d1be89fe4 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/Multideclaration.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/Multideclaration.after.kt @@ -1,15 +1,15 @@ fun test() { val (a, b) = - Pair(true, false) + Pair(true, false) val (c, d) = Pair(true, false) val ( - distributor, - items, - shippingMethods, - addresses, - preferredAddressId + distributor, + items, + shippingMethods, + addresses, + preferredAddressId ) = argument -} \ No newline at end of file +} diff --git a/plugins/kotlin/idea/tests/testData/formatter/MultilineStringEntry6.after.kt b/plugins/kotlin/idea/tests/testData/formatter/MultilineStringEntry6.after.kt index 450d05f14fcd..9113ea98c28c 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/MultilineStringEntry6.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/MultilineStringEntry6.after.kt @@ -1,7 +1,7 @@ fun test() { "start ${ println( - "sd" + "sd" ) } end" -} \ No newline at end of file +} diff --git a/plugins/kotlin/idea/tests/testData/formatter/NewLineForRBrace.after.kt b/plugins/kotlin/idea/tests/testData/formatter/NewLineForRBrace.after.kt index 0f435b58ef33..ad925cbf91ad 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/NewLineForRBrace.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/NewLineForRBrace.after.kt @@ -31,8 +31,10 @@ enum class E1 { } } -fun e = fun(a: Int, - b: String) { +fun e = fun( + a: Int, + b: String +) { } /** @@ -47,4 +49,4 @@ fun commented2() {} // Comment fun commented3() {} -// TRAILING_COMMA: false \ No newline at end of file +// TRAILING_COMMA: false diff --git a/plugins/kotlin/idea/tests/testData/formatter/ParameterAnnotationWrap.after.kt b/plugins/kotlin/idea/tests/testData/formatter/ParameterAnnotationWrap.after.kt index 52c559b9c488..df62a36b345b 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/ParameterAnnotationWrap.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/ParameterAnnotationWrap.after.kt @@ -1,7 +1,9 @@ -fun foo(@Deprecated("x") - x: Int, - @Deprecated("y") - @Deprecated("z") - y: Int) +fun foo( + @Deprecated("x") + x: Int, + @Deprecated("y") + @Deprecated("z") + y: Int +) // SET_INT: PARAMETER_ANNOTATION_WRAP = 2 diff --git a/plugins/kotlin/idea/tests/testData/formatter/ParameterDocComments.after.kt b/plugins/kotlin/idea/tests/testData/formatter/ParameterDocComments.after.kt index 05b7fce125f2..68f3981416ea 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/ParameterDocComments.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/ParameterDocComments.after.kt @@ -1,21 +1,22 @@ class A( - /** - * Doc comment - */ - public val p1: Int, - /** Doc comment */ - public val p2: Int, - /** - * Doc - */ - val p2: String) + /** + * Doc comment + */ + public val p1: Int, + /** Doc comment */ + public val p2: Int, + /** + * Doc + */ + val p2: String +) class B( - /** Doc1 */ - val v: Int, + /** Doc1 */ + val v: Int, - /** - * Doc2 - */ - val v2: Int -) \ No newline at end of file + /** + * Doc2 + */ + val v2: Int +) diff --git a/plugins/kotlin/idea/tests/testData/formatter/Parameters.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/Parameters.after.inv.kt index 276b8d36e737..a608b479f881 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/Parameters.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/Parameters.after.inv.kt @@ -1,9 +1,9 @@ fun some( - a :Int, - b :String, c :Int, - d :String, e :Int + a :Int, + b :String, c :Int, + d :String, e :Int ) { } // SET_FALSE: SPACE_BEFORE_TYPE_COLON -// SET_TRUE: SPACE_AFTER_TYPE_COLON \ No newline at end of file +// SET_TRUE: SPACE_AFTER_TYPE_COLON diff --git a/plugins/kotlin/idea/tests/testData/formatter/Parameters.after.kt b/plugins/kotlin/idea/tests/testData/formatter/Parameters.after.kt index 7d801a1931e4..0b35cab05b0b 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/Parameters.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/Parameters.after.kt @@ -1,9 +1,9 @@ fun some( - a: Int, - b: String, c: Int, - d: String, e: Int + a: Int, + b: String, c: Int, + d: String, e: Int ) { } // SET_FALSE: SPACE_BEFORE_TYPE_COLON -// SET_TRUE: SPACE_AFTER_TYPE_COLON \ No newline at end of file +// SET_TRUE: SPACE_AFTER_TYPE_COLON diff --git a/plugins/kotlin/idea/tests/testData/formatter/PrimaryConstructor.after.kt b/plugins/kotlin/idea/tests/testData/formatter/PrimaryConstructor.after.kt index 47aeb1899b3e..5d8194de4bbb 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/PrimaryConstructor.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/PrimaryConstructor.after.kt @@ -8,24 +8,24 @@ class A4 private @ann1 protected @[ann2] constructor() { class A5 private @ann constructor -() + () class A6 /* faddf */ private () class A7 private @ann constructor -() + () class A8 // eol comment private @ann constructor -() + () class A9 // eol comment private // eol comment @ann constructor// eol comment -() + () class A10 protected @ann constructor() @@ -34,4 +34,4 @@ class A11 protected @ann constructor -() + () diff --git a/plugins/kotlin/idea/tests/testData/formatter/PropertyWithInference.after.kt b/plugins/kotlin/idea/tests/testData/formatter/PropertyWithInference.after.kt index 9fcbe03018f2..f71a4bb8a1ec 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/PropertyWithInference.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/PropertyWithInference.after.kt @@ -1,3 +1,3 @@ val a = - 12 + 12 diff --git a/plugins/kotlin/idea/tests/testData/formatter/RightBracketOnNewLine.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/RightBracketOnNewLine.after.inv.kt index 11116308c4b3..c3ac9740f1f7 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/RightBracketOnNewLine.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/RightBracketOnNewLine.after.inv.kt @@ -1,8 +1,9 @@ class Test { - fun someLong(a: Int + fun someLong( + a: Int ) { } } // SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS -// TRAILING_COMMA: false \ No newline at end of file +// TRAILING_COMMA: false diff --git a/plugins/kotlin/idea/tests/testData/formatter/RightBracketOnNewLine.after.kt b/plugins/kotlin/idea/tests/testData/formatter/RightBracketOnNewLine.after.kt index 39292fbda114..6412e45d2e1e 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/RightBracketOnNewLine.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/RightBracketOnNewLine.after.kt @@ -1,8 +1,9 @@ class Test { - fun someLong(a: Int + fun someLong( + a: Int ) { } } // SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS -// TRAILING_COMMA: false \ No newline at end of file +// TRAILING_COMMA: false diff --git a/plugins/kotlin/idea/tests/testData/formatter/SpaceAroundExtendColonInObjects.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/SpaceAroundExtendColonInObjects.after.inv.kt index 9ae256f43913..f1a175db2529 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/SpaceAroundExtendColonInObjects.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/SpaceAroundExtendColonInObjects.after.inv.kt @@ -11,7 +11,7 @@ object Some3 : - A + A val a = object: A {} @@ -25,7 +25,7 @@ class B { class C { companion object: - A { + A { } } diff --git a/plugins/kotlin/idea/tests/testData/formatter/SpaceAroundExtendColonInObjects.after.kt b/plugins/kotlin/idea/tests/testData/formatter/SpaceAroundExtendColonInObjects.after.kt index 7ab9a36cb414..a193acda9f43 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/SpaceAroundExtendColonInObjects.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/SpaceAroundExtendColonInObjects.after.kt @@ -11,7 +11,7 @@ object Some3 : - A + A val a = object :A {} @@ -25,7 +25,7 @@ class B { class C { companion object : - A { + A { } } diff --git a/plugins/kotlin/idea/tests/testData/formatter/SpacesInQualifiedExpressions.after.kt b/plugins/kotlin/idea/tests/testData/formatter/SpacesInQualifiedExpressions.after.kt index 49201ea262fb..2356753c6c7d 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/SpacesInQualifiedExpressions.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/SpacesInQualifiedExpressions.after.kt @@ -14,7 +14,7 @@ fun test(t: Test) { t - .foo() + .foo() t.foo().foo() @@ -29,7 +29,7 @@ fun test(t: Test) { t - ?.foo() + ?.foo() t?.foo()?.foo() -} \ No newline at end of file +} diff --git a/plugins/kotlin/idea/tests/testData/formatter/ValVarSpaces.after.kt b/plugins/kotlin/idea/tests/testData/formatter/ValVarSpaces.after.kt index 018f0816edcc..06c0bfffe61e 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/ValVarSpaces.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/ValVarSpaces.after.kt @@ -1,7 +1,9 @@ -class Foo(val x: Int, - var y: Int) { +class Foo( + val x: Int, + var y: Int +) { val a = 1 var b = 2 } -// TRAILING_COMMA: false \ No newline at end of file +// TRAILING_COMMA: false diff --git a/plugins/kotlin/idea/tests/testData/formatter/WhenComment.after.kt b/plugins/kotlin/idea/tests/testData/formatter/WhenComment.after.kt index 173fe553f36e..97a8a2326f68 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/WhenComment.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/WhenComment.after.kt @@ -18,8 +18,8 @@ fun foo(i: Int) { /* - Block multiline - */ + Block multiline + */ 5 -> 6 /** Doc */ @@ -53,4 +53,4 @@ fun foo(i: Int) { else -> 43 // 42 } -} \ No newline at end of file +} diff --git a/plugins/kotlin/idea/tests/testData/formatter/WhereClause.after.kt b/plugins/kotlin/idea/tests/testData/formatter/WhereClause.after.kt index 61fafbbbbf02..31c19bdc68dd 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/WhereClause.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/WhereClause.after.kt @@ -1,6 +1,6 @@ abstract class RustNavigationContributorBase protected constructor( - private val indexKey: StubIndexKey, - private val clazz: Class + private val indexKey: StubIndexKey, + private val clazz: Class ) : ChooseByNameContributor, GotoClassContributor where T : NavigationItem, T : RustNamedElement { diff --git a/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrapping.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrapping.after.inv.kt index 94301dd4df9c..19df16e8f2ff 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrapping.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrapping.after.inv.kt @@ -1,40 +1,40 @@ val x = foo - .bar() - .baz() - .quux() + .bar() + .baz() + .quux() val x2 = foo() - .bar() - .baz() - .quux() + .bar() + .baz() + .quux() val x3 = ((foo().bar())) - .baz() - .quux() + .baz() + .quux() val x4 = (foo() - .bar() - .baz()).quux() + .bar() + .baz()).quux() val x5 = (foo()) - .bar() - .baz() - .quux() + .bar() + .baz() + .quux() val x6 = foo!! - .bar() - .baz()!! - .quux()!! + .bar() + .baz()!! + .quux()!! val x7 = foo!! - .bar() - .baz()!! - .quux()!! + .bar() + .baz()!! + .quux()!! val x8 = foo!!!!!!!! - .bar() - .baz()!! - .quux()!! + .bar() + .baz()!! + .quux()!! val x9 = ((b!!)!!!!)!!.f @@ -43,88 +43,90 @@ val x10 = a()!!.a() val x11 = a()!!!!.a() val x12 = a()!! - .a()!! - .a() + .a()!! + .a() val x13 = a()!!!! - .a() - .a() + .a() + .a() val x14 = a().a() val x15 = (a()).a() val x16 = (a()) - .a() - .a() + .a() + .a() val x17 = (a().a()).a() val x18 = (a().a()) - .a() - .a() + .a() + .a() val x18 = (a() - .a() - .a()) - .a() - .a() + .a() + .a()) + .a() + .a() val x19 = (a() - .a() - .a()).a() + .a() + .a()).a() val x20 = foo!!.foo - .baz()!! - .quux()!!.foo.foo.foo.baz().foo - .baz() - .baz() + .baz()!! + .quux()!!.foo.foo.foo.baz().foo + .baz() + .baz() -val y = xyzzy(foo +val y = xyzzy( + foo .bar() .baz() - .quux()) + .quux() +) fun foo() { foo - .bar() - .baz() - .quux() + .bar() + .baz() + .quux() z = foo - .bar() - .baz() - .quux() + .bar() + .baz() + .quux() z += foo - .bar() - .baz() - .quux() + .bar() + .baz() + .quux() return foo - .bar() - .baz() - .quux() + .bar() + .baz() + .quux() } fun top() = "" - .plus("") - .plus("") + .plus("") + .plus("") class C { fun member() = "" - .plus("") - .plus("") + .plus("") + .plus("") } fun foo() { fun local() = "" - .plus("") - .plus("") + .plus("") + .plus("") val anonymous = fun() = "" - .plus("") - .plus("") + .plus("") + .plus("") } // SET_INT: METHOD_CALL_CHAIN_WRAP = 2 diff --git a/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrapping.after.kt b/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrapping.after.kt index 89f53d5d1341..5a1a7fae4230 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrapping.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrapping.after.kt @@ -1,32 +1,32 @@ val x = foo.bar() - .baz() - .quux() + .baz() + .quux() val x2 = foo().bar() - .baz() - .quux() + .baz() + .quux() val x3 = ((foo().bar())).baz() - .quux() + .quux() val x4 = (foo().bar() - .baz()).quux() + .baz()).quux() val x5 = (foo()).bar() - .baz() - .quux() + .baz() + .quux() val x6 = foo!!.bar() - .baz()!! - .quux()!! + .baz()!! + .quux()!! val x7 = foo!!.bar() - .baz()!! - .quux()!! + .baz()!! + .quux()!! val x8 = foo!!!!!!!!.bar() - .baz()!! - .quux()!! + .baz()!! + .quux()!! val x9 = ((b!!)!!!!)!!.f @@ -35,70 +35,72 @@ val x10 = a()!!.a() val x11 = a()!!!!.a() val x12 = a()!!.a()!! - .a() + .a() val x13 = a()!!!!.a() - .a() + .a() val x14 = a().a() val x15 = (a()).a() val x16 = (a()).a() - .a() + .a() val x17 = (a().a()).a() val x18 = (a().a()).a() - .a() + .a() val x18 = (a().a() - .a()).a() - .a() + .a()).a() + .a() val x19 = (a().a() - .a()).a() + .a()).a() val x20 = foo!!.foo.baz()!! - .quux()!!.foo.foo.foo.baz().foo.baz() - .baz() + .quux()!!.foo.foo.foo.baz().foo.baz() + .baz() -val y = xyzzy(foo.bar() +val y = xyzzy( + foo.bar() .baz() - .quux()) + .quux() +) fun foo() { foo.bar() - .baz() - .quux() + .baz() + .quux() z = foo.bar() - .baz() - .quux() + .baz() + .quux() z += foo.bar() - .baz() - .quux() + .baz() + .quux() return foo.bar() - .baz() - .quux() + .baz() + .quux() } fun top() = "".plus("") - .plus("") + .plus("") class C { fun member() = "".plus("") - .plus("") + .plus("") } fun foo() { fun local() = "".plus("") - .plus("") + .plus("") val anonymous = fun() = "".plus("") - .plus("") + .plus("") } // SET_INT: METHOD_CALL_CHAIN_WRAP = 2 diff --git a/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrapping2.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrapping2.after.inv.kt index 87ef3d35cc9f..77e4fb8fdf2e 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrapping2.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrapping2.after.inv.kt @@ -15,30 +15,39 @@ fun test() { (INSTANCE).awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val b = INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val b = + INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val b = (INSTANCE).awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val b = + (INSTANCE).awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val b = (INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww).awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val b = + (INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww).awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val b = (((INSTANCE).awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww)).awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val b = + (((INSTANCE).awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww)).awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww val b = INSTANCE.adad.adad val b = INSTANCE.adad - val b = INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val b = + INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val b = INSTANCE!!!!.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val b = + INSTANCE!!!!.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val b = INSTANCE!!!!.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val b = + INSTANCE!!!!.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val b = INSTANCE!!.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val b = + INSTANCE!!.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val b = if (INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww == INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww) - true - else - false + val b = + if (INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww == INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww) + true + else + false if (INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww == INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww) true @@ -50,27 +59,35 @@ fun test() { else false - val bawdawdwad = INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val bawdawdwad = + INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val c = INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val c = + INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val c = INSTANCE().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().adad.adawd + val c = + INSTANCE().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().adad.adawd - val c = INSTANCE().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val c = + INSTANCE().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww } -val b = INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww +val b = + INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww -val bawdawdwad = INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww +val bawdawdwad = + INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww -val c = INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww +val c = + INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww val c2 = INSTANCE - .awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() - .awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + .awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() + .awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww -val c = INSTANCE().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().adad.adawd +val c = + INSTANCE().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().adad.adawd val x = foo.bar().baz().quux() @@ -90,35 +107,43 @@ val x8 = foo!!!!!!!!.bar().baz()!!.quux()!! val x9 = ((b!!)!!!!)!!.f -val x10 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!.a() +val x10 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!.a() -val x11 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!!!.a() +val x11 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!!!.a() -val x12 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!! +val x12 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!! .a()!!.a() -val x13 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!!! +val x13 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!!! .a().a() -val x14 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().a() +val x14 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().a() -val x15 = (awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() +val x15 = + (awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() -val x16 = (awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()) +val x16 = + (awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()) .a() .awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() -val x17 = (a().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() +val x17 = + (a().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() val x18 = (a().a()).a().a() val x18 = (a() - .awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() - .a()).a().a() + .awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() + .a()).a().a() val x19 = (a() - .awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() - .a()).a() + .awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() + .a()).a() // SET_INT: METHOD_CALL_CHAIN_WRAP = 1 -// SET_FALSE: WRAP_FIRST_METHOD_IN_CALL_CHAIN \ No newline at end of file +// SET_FALSE: WRAP_FIRST_METHOD_IN_CALL_CHAIN diff --git a/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrapping2.after.kt b/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrapping2.after.kt index 228cde980317..9ccbf9a59f21 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrapping2.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrapping2.after.kt @@ -15,30 +15,39 @@ fun test() { (INSTANCE).awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val b = INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val b = + INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val b = (INSTANCE).awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val b = + (INSTANCE).awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val b = (INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww).awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val b = + (INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww).awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val b = (((INSTANCE).awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww)).awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val b = + (((INSTANCE).awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww)).awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww val b = INSTANCE.adad.adad val b = INSTANCE.adad - val b = INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val b = + INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val b = INSTANCE!!!!.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val b = + INSTANCE!!!!.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val b = INSTANCE!!!!.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val b = + INSTANCE!!!!.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val b = INSTANCE!!.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val b = + INSTANCE!!.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val b = if (INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww == INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww) - true - else - false + val b = + if (INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww == INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww) + true + else + false if (INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww == INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww) true @@ -50,26 +59,35 @@ fun test() { else false - val bawdawdwad = INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val bawdawdwad = + INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val c = INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val c = + INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww - val c = INSTANCE().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().adad.adawd + val c = + INSTANCE().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().adad.adawd - val c = INSTANCE().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww + val c = + INSTANCE().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww } -val b = INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww +val b = + INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww -val bawdawdwad = INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww +val bawdawdwad = + INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww -val c = INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww +val c = + INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww -val c2 = INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() +val c2 = + INSTANCE.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() .awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww -val c = INSTANCE().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().adad.adawd +val c = + INSTANCE().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww.awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().adad.adawd val x = foo.bar().baz().quux() @@ -89,32 +107,42 @@ val x8 = foo!!!!!!!!.bar().baz()!!.quux()!! val x9 = ((b!!)!!!!)!!.f -val x10 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!.a() +val x10 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!.a() -val x11 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!!!.a() +val x11 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!!!.a() -val x12 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!.a()!! +val x12 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!.a()!! .a() -val x13 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!!!.a() +val x13 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!!!.a() .a() -val x14 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().a() +val x14 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().a() -val x15 = (awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() +val x15 = + (awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() -val x16 = (awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() +val x16 = + (awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() .awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() -val x17 = (a().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() +val x17 = + (a().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() val x18 = (a().a()).a().a() -val x18 = (a().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() +val x18 = + (a().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() .a()).a().a() -val x19 = (a().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() +val x19 = + (a().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() .a()).a() // SET_INT: METHOD_CALL_CHAIN_WRAP = 1 -// SET_FALSE: WRAP_FIRST_METHOD_IN_CALL_CHAIN \ No newline at end of file +// SET_FALSE: WRAP_FIRST_METHOD_IN_CALL_CHAIN diff --git a/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrappingChopDown.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrappingChopDown.after.inv.kt index 306b7db9490d..4a3190241275 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrappingChopDown.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrappingChopDown.after.inv.kt @@ -300,27 +300,35 @@ val x8 = foo!!!!!!!!.bar().baz()!!.quux()!! val x9 = ((b!!)!!!!)!!.f -val x10 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!.a() +val x10 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!.a() -val x11 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!!!.a() +val x11 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!!!.a() -val x12 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!! - .a()!! - .a() +val x12 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!! + .a()!! + .a() -val x13 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!!! - .a() - .a() +val x13 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!!! + .a() + .a() -val x14 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().a() +val x14 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().a() -val x15 = (awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() +val x15 = + (awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() -val x16 = (awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()) - .a() - .awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() +val x16 = + (awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()) + .a() + .awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() -val x17 = (a().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() +val x17 = + (a().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() val x18 = (a().a()).a().a() @@ -335,4 +343,4 @@ val x19 = (a() // SET_INT: METHOD_CALL_CHAIN_WRAP = 5 // SET_FALSE: WRAP_FIRST_METHOD_IN_CALL_CHAIN // SET_FALSE: CONTINUATION_INDENT_FOR_CHAINED_CALLS -// RIGHT_MARGIN: 120 \ No newline at end of file +// RIGHT_MARGIN: 120 diff --git a/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrappingChopDown.after.kt b/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrappingChopDown.after.kt index 23a892c088bf..3b891cbf0ec7 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrappingChopDown.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrappingChopDown.after.kt @@ -286,34 +286,44 @@ val x8 = foo!!!!!!!!.bar().baz()!!.quux()!! val x9 = ((b!!)!!!!)!!.f -val x10 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!.a() +val x10 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!.a() -val x11 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!!!.a() +val x11 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!!!.a() -val x12 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!.a()!! - .a() +val x12 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!.a()!! + .a() -val x13 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!!!.a() - .a() +val x13 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()!!!!.a() + .a() -val x14 = awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().a() +val x14 = + awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww().a() -val x15 = (awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() +val x15 = + (awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() -val x16 = (awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() - .awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() +val x16 = + (awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() + .awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() -val x17 = (a().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() +val x17 = + (a().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww()).a() val x18 = (a().a()).a().a() -val x18 = (a().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() - .a()).a().a() +val x18 = + (a().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() + .a()).a().a() -val x19 = (a().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() - .a()).a() +val x19 = + (a().awswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswswwawswswswswswswsww() + .a()).a() // SET_INT: METHOD_CALL_CHAIN_WRAP = 5 // SET_FALSE: WRAP_FIRST_METHOD_IN_CALL_CHAIN // SET_FALSE: CONTINUATION_INDENT_FOR_CHAINED_CALLS -// RIGHT_MARGIN: 120 \ No newline at end of file +// RIGHT_MARGIN: 120 diff --git a/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrappingInElvis.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrappingInElvis.after.inv.kt index c0d1ac680d09..c6106469c70c 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrappingInElvis.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrappingInElvis.after.inv.kt @@ -1,12 +1,12 @@ fun f(list: List) { val result = list - .filter { it % 2 == 0 } - .max() ?: -1 + .filter { it % 2 == 0 } + .max() ?: -1 list - .filter { it % 2 == 0 } - .max() - ?: -1 + .filter { it % 2 == 0 } + .max() + ?: -1 } // 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 diff --git a/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrappingInElvis.after.kt b/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrappingInElvis.after.kt index e4ed295acbb2..aa3e47dbc2cf 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrappingInElvis.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/callChain/CallChainWrappingInElvis.after.kt @@ -1,10 +1,10 @@ fun f(list: List) { val result = list.filter { it % 2 == 0 } - .max() ?: -1 + .max() ?: -1 list.filter { it % 2 == 0 } - .max() - ?: -1 + .max() + ?: -1 } // 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 diff --git a/plugins/kotlin/idea/tests/testData/formatter/callChain/ConsecutiveCalls.after.kt b/plugins/kotlin/idea/tests/testData/formatter/callChain/ConsecutiveCalls.after.kt index 323c6f491ec9..4aa3324caaba 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/callChain/ConsecutiveCalls.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/callChain/ConsecutiveCalls.after.kt @@ -1,5 +1,5 @@ fun test() { MyFunc1() - .MyFunc2() - .MyFunc3() -} \ No newline at end of file + .MyFunc2() + .MyFunc3() +} diff --git a/plugins/kotlin/idea/tests/testData/formatter/callChain/ConsecutiveSafeCallsIndent.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/callChain/ConsecutiveSafeCallsIndent.after.inv.kt index cc7addbff56d..9c630fddb23d 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/callChain/ConsecutiveSafeCallsIndent.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/callChain/ConsecutiveSafeCallsIndent.after.inv.kt @@ -3,10 +3,10 @@ class Some { } public fun bar(): String? = - Some() - ?.some() - ?.some() - ?.some()!! - .toString() + Some() + ?.some() + ?.some() + ?.some()!! + .toString() // SET_TRUE: CONTINUATION_INDENT_FOR_CHAINED_CALLS diff --git a/plugins/kotlin/idea/tests/testData/formatter/callChain/ConsecutiveSafeCallsIndent.after.kt b/plugins/kotlin/idea/tests/testData/formatter/callChain/ConsecutiveSafeCallsIndent.after.kt index a0e3293a173f..a79e3c306728 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/callChain/ConsecutiveSafeCallsIndent.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/callChain/ConsecutiveSafeCallsIndent.after.kt @@ -3,10 +3,10 @@ class Some { } public fun bar(): String? = - Some() - ?.some() - ?.some() - ?.some()!! - .toString() + Some() + ?.some() + ?.some() + ?.some()!! + .toString() // SET_TRUE: CONTINUATION_INDENT_FOR_CHAINED_CALLS diff --git a/plugins/kotlin/idea/tests/testData/formatter/callChain/FunctionLiteralsInChainCalls.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/callChain/FunctionLiteralsInChainCalls.after.inv.kt index 1a2fca92a4d5..07065771eb1a 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/callChain/FunctionLiteralsInChainCalls.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/callChain/FunctionLiteralsInChainCalls.after.inv.kt @@ -35,7 +35,7 @@ fun test3() { fun test4() { val abc = ArrayList().mapTo( - LinkedHashSet() + LinkedHashSet() ) { it * 2 } @@ -52,4 +52,4 @@ fun testWithComments() { } // SET_TRUE: CONTINUATION_INDENT_FOR_CHAINED_CALLS -// SET_TRUE: ALLOW_TRAILING_COMMA \ No newline at end of file +// SET_TRUE: ALLOW_TRAILING_COMMA diff --git a/plugins/kotlin/idea/tests/testData/formatter/callChain/FunctionLiteralsInChainCalls.after.kt b/plugins/kotlin/idea/tests/testData/formatter/callChain/FunctionLiteralsInChainCalls.after.kt index f8c9ca2289e1..dad62d335f8e 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/callChain/FunctionLiteralsInChainCalls.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/callChain/FunctionLiteralsInChainCalls.after.kt @@ -35,7 +35,7 @@ fun test3() { fun test4() { val abc = ArrayList().mapTo( - LinkedHashSet() + LinkedHashSet() ) { it * 2 } @@ -52,4 +52,4 @@ fun testWithComments() { } // SET_TRUE: CONTINUATION_INDENT_FOR_CHAINED_CALLS -// SET_TRUE: ALLOW_TRAILING_COMMA \ No newline at end of file +// SET_TRUE: ALLOW_TRAILING_COMMA diff --git a/plugins/kotlin/idea/tests/testData/formatter/callChain/KT15099.after.kt b/plugins/kotlin/idea/tests/testData/formatter/callChain/KT15099.after.kt index 15548e8c4487..a64ead54a7f4 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/callChain/KT15099.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/callChain/KT15099.after.kt @@ -1,8 +1,8 @@ fun test() { Single.just(Object()) - .map { - it - }.map { - it // The code unexpectedly shifts to the left - } -} \ No newline at end of file + .map { + it + }.map { + it // The code unexpectedly shifts to the left + } +} diff --git a/plugins/kotlin/idea/tests/testData/formatter/callChain/KT22071.after.kt b/plugins/kotlin/idea/tests/testData/formatter/callChain/KT22071.after.kt index 1f5030b36773..43fa7019a68d 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/callChain/KT22071.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/callChain/KT22071.after.kt @@ -41,7 +41,8 @@ abstract class TemplateGroupBase : TemplateGroup { companion object { private val typeMemberTemplate = MemberTemplate::class.createType() - private val typeIterableOfMemberTemplates = Iterable::class.createType(arguments = listOf(KTypeProjection.invariant(typeMemberTemplate))) + private val typeIterableOfMemberTemplates = + Iterable::class.createType(arguments = listOf(KTypeProjection.invariant(typeMemberTemplate))) } } diff --git a/plugins/kotlin/idea/tests/testData/formatter/callChain/KT37545.after.kt b/plugins/kotlin/idea/tests/testData/formatter/callChain/KT37545.after.kt index eda3ac86478f..d8edf34cde36 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/callChain/KT37545.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/callChain/KT37545.after.kt @@ -3,16 +3,16 @@ import X.combine class IndentationIssue { fun method() { X.Y.combine( - 1, - 1 + 1, + 1 ) - .let { - "zzz" - } + .let { + "zzz" + } X.Y.combine( - 1, - 1 + 1, + 1 ).let { "zzz" } @@ -20,69 +20,69 @@ class IndentationIssue { X.Y./* comment */combine( - 1, - 1 + 1, + 1 ) - .let { - "zzz" - } + .let { + "zzz" + } X.Y./* comment */combine( - 1, - 1 + 1, + 1 ).let { "zzz" } (X.Y.combine( - 1, - 1 + 1, + 1 ) ).let { - "zzz" - } + "zzz" + } X.Y - .combine( - 1, - 1 - ) - .let { "zzz" } - - X.Y - .combine( - 1, - 1 - ).let { - "zzz" - } - - X - .Y - .combine( - 1, - 1 - ) - .let { "zzz" } - - X - .Y.combine( - 1, - 1 - ) - .let { "zzz" } - - combine( + .combine( 1, 1 - ) - .let { "zzz" } + ) + .let { "zzz" } + + X.Y + .combine( + 1, + 1 + ).let { + "zzz" + } + + X + .Y + .combine( + 1, + 1 + ) + .let { "zzz" } + + X + .Y.combine( + 1, + 1 + ) + .let { "zzz" } combine( - 1, - 2 + 1, + 1 + ) + .let { "zzz" } + + combine( + 1, + 2 ).let { "zzz" }.let { @@ -90,8 +90,8 @@ class IndentationIssue { } (combine( - 1, - 2 + 1, + 2 ).let { "zzz" }).let { @@ -99,18 +99,18 @@ class IndentationIssue { } (combine( - 1, - 2 + 1, + 2 ) - .let { - "zzz" - }).let { - "zzz" - } + .let { + "zzz" + }).let { + "zzz" + } combine( - 1, - 2 + 1, + 2 ).let { "zzz" }!!.let { @@ -118,38 +118,38 @@ class IndentationIssue { } combine( - 1, - 2 + 1, + 2 ) - .let { - "zzz" - }!!.let { - "zzz" - } + .let { + "zzz" + }!!.let { + "zzz" + } (combine( - 1, - 2 + 1, + 2 ) - .let { - "zzz" - })!!.let { - "zzz" - } + .let { + "zzz" + })!!.let { + "zzz" + } ((combine( - 1, - 2 + 1, + 2 ) ).let { - "zzz" - }!!)!!.let { - "zzz" - } + "zzz" + }!!)!!.let { + "zzz" + } ((combine( - 1, - 2 + 1, + 2 )).let { "zzz" }!!)!!.let { @@ -157,14 +157,14 @@ class IndentationIssue { } ((combine( - 1, - 2 + 1, + 2 )).let { "zzz" }!! )!!.let { - "zzz" - } + "zzz" + } } } @@ -172,4 +172,4 @@ object X { fun combine(x: L, y: R): T = TODO() val Y get() = this -} \ No newline at end of file +} diff --git a/plugins/kotlin/idea/tests/testData/formatter/parameterList/ArgumentListChopAsNeeded.after.kt b/plugins/kotlin/idea/tests/testData/formatter/parameterList/ArgumentListChopAsNeeded.after.kt index 57213a05f534..fbf5c0a3ce76 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/parameterList/ArgumentListChopAsNeeded.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/parameterList/ArgumentListChopAsNeeded.after.kt @@ -10,12 +10,15 @@ fun foo() { testtest(foofoo) testtesttesttest( - foofoofoofoofoofoofoofoofoofoofoofoo) + foofoofoofoofoofoofoofoofoofoofoofoo + ) testtest(foobar, barfoo) - testtesttesttest(foofoo, - barbar, - foobar, - barfoo) -} \ No newline at end of file + testtesttesttest( + foofoo, + barbar, + foobar, + barfoo + ) +} diff --git a/plugins/kotlin/idea/tests/testData/formatter/parameterList/ArgumentListWrapAlways.after.kt b/plugins/kotlin/idea/tests/testData/formatter/parameterList/ArgumentListWrapAlways.after.kt index 5d5a1d8d0c20..779f31ed91d5 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/parameterList/ArgumentListWrapAlways.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/parameterList/ArgumentListWrapAlways.after.kt @@ -11,11 +11,15 @@ fun foo() { testtesttesttest(foofoofoofoofoofoofoofoofoofoofoofoo) - testtest(foobar, - barfoo) + testtest( + foobar, + barfoo + ) - testtesttesttest(foofoo, - barbar, - foobar, - barfoo) -} \ No newline at end of file + testtesttesttest( + foofoo, + barbar, + foobar, + barfoo + ) +} diff --git a/plugins/kotlin/idea/tests/testData/formatter/parameterList/ArgumentListWrapAsNeeded.after.kt b/plugins/kotlin/idea/tests/testData/formatter/parameterList/ArgumentListWrapAsNeeded.after.kt index 41dbfd097787..1ad31e82b374 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/parameterList/ArgumentListWrapAsNeeded.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/parameterList/ArgumentListWrapAsNeeded.after.kt @@ -10,12 +10,13 @@ fun foo() { testtest(foofoo) testtesttesttest( - foofoofoofoofoofoofoofoofoofoofoofoo) + foofoofoofoofoofoofoofoofoofoofoofoo + ) testtest(foobar, barfoo) - testtesttesttest(foofoo, - barbar, - foobar, - barfoo) -} \ No newline at end of file + testtesttesttest( + foofoo, barbar, + foobar, barfoo + ) +} diff --git a/plugins/kotlin/idea/tests/testData/formatter/parameterList/DefaultParameterValues.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/parameterList/DefaultParameterValues.after.inv.kt index f91e65f4fb95..a29822c97629 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/parameterList/DefaultParameterValues.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/parameterList/DefaultParameterValues.after.inv.kt @@ -1,12 +1,12 @@ fun foo( - x: Int = - 42 + x: Int = + 42 ) { } class C( - val x: Int = - 42 + val x: Int = + 42 ) // SET_TRUE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES diff --git a/plugins/kotlin/idea/tests/testData/formatter/parameterList/DefaultParameterValues.after.kt b/plugins/kotlin/idea/tests/testData/formatter/parameterList/DefaultParameterValues.after.kt index 0c5e97ef42d7..308c21a56fcb 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/parameterList/DefaultParameterValues.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/parameterList/DefaultParameterValues.after.kt @@ -1,12 +1,12 @@ fun foo( - x: Int = - 42 + x: Int = + 42 ) { } class C( - val x: Int = - 42 + val x: Int = + 42 ) // SET_TRUE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES diff --git a/plugins/kotlin/idea/tests/testData/formatter/parameterList/ParameterListChopAsNeeded.after.kt b/plugins/kotlin/idea/tests/testData/formatter/parameterList/ParameterListChopAsNeeded.after.kt index cae295a237ed..6532012dbac0 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/parameterList/ParameterListChopAsNeeded.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/parameterList/ParameterListChopAsNeeded.after.kt @@ -12,10 +12,12 @@ 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) { @@ -39,26 +41,45 @@ class LongLongLongLongNameCLass class ShorName class SN -class A(longLongLongLongNameCLass1: LongLongLongLongNameCLass, - longLongLongLongNameCLass2: LongLongLongLongNameCLass, - longLongLongLongNameCLass3: LongLongLongLongNameCLass) { +class A( + longLongLongLongNameCLass1: LongLongLongLongNameCLass, + longLongLongLongNameCLass2: LongLongLongLongNameCLass, + longLongLongLongNameCLass3: LongLongLongLongNameCLass +) { constructor( - longLongLongLongNameCLass1: LongLongLongLongNameCLass, - longLongLongLongNameCLass2: LongLongLongLongNameCLass, - longLongLongLongNameCLass3: LongLongLongLongNameCLass) { + 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) { - constructor(a: LongLongLongLongNameCLass, - b: LongLongLongLongNameCLass, - c: LongLongLongLongNameCLass) { + c: LongLongLongLongNameCLass + ) { } } -class C(sn1: ShorName, +class C( + sn1: ShorName, + sn2: ShorName, + sn3: ShorName, + sn4: ShorName, + sn5: ShorName, + sn6: ShorName, + sn6: ShorName, + sn8: ShorName, + sn9: ShorName +) { + constructor( + sn1: ShorName, sn2: ShorName, sn3: ShorName, sn4: ShorName, @@ -66,20 +87,29 @@ class C(sn1: ShorName, 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 + ) { } } -class D(sn1: 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, @@ -92,27 +122,17 @@ class D(sn1: 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) { + sn14: SN + ) { } } -class E(longLongLongLongNameCLass1: LongLongLongLongNameCLass) { +class E( + longLongLongLongNameCLass1: LongLongLongLongNameCLass +) { constructor( - longLongLongLongNameCLass1: LongLongLongLongNameCLass) { + longLongLongLongNameCLass1: LongLongLongLongNameCLass + ) { } } diff --git a/plugins/kotlin/idea/tests/testData/formatter/parameterList/ParameterListWrapAlways.after.kt b/plugins/kotlin/idea/tests/testData/formatter/parameterList/ParameterListWrapAlways.after.kt index 270799b10df0..044230dc6a50 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/parameterList/ParameterListWrapAlways.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/parameterList/ParameterListWrapAlways.after.kt @@ -10,23 +10,31 @@ 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) { @@ -50,25 +58,45 @@ 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) { - 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) { - constructor(a: LongLongLongLongNameCLass, - b: LongLongLongLongNameCLass, - c: LongLongLongLongNameCLass) { + c: LongLongLongLongNameCLass + ) { } } -class C(sn1: ShorName, +class C( + sn1: ShorName, + sn2: ShorName, + sn3: ShorName, + sn4: ShorName, + sn5: ShorName, + sn6: ShorName, + sn6: ShorName, + sn8: ShorName, + sn9: ShorName +) { + constructor( + sn1: ShorName, sn2: ShorName, sn3: ShorName, sn4: ShorName, @@ -76,20 +104,29 @@ class C(sn1: ShorName, 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 + ) { } } -class D(sn1: 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, @@ -102,21 +139,8 @@ class D(sn1: 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) { + sn14: SN + ) { } } @@ -135,16 +159,35 @@ class G(sn1: ShorName) { } } -class H(sn1: SN, - sn2: SN) { +class H( + sn1: SN, + sn2: SN +) { constructor(sn1: SN) { } } -class I(sn1: SN, - @field:Some val sn2: SN, +class I( + sn1: SN, + @field:Some val 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, + @Some sn4: SN, sn5: SN, sn6: SN, sn6: SN, @@ -154,20 +197,7 @@ class I(sn1: SN, 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 + ) { } } diff --git a/plugins/kotlin/idea/tests/testData/formatter/parameterList/ParameterListWrapAsNeeded.after.kt b/plugins/kotlin/idea/tests/testData/formatter/parameterList/ParameterListWrapAsNeeded.after.kt index c119f6f61cd8..73a7a4f5e883 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/parameterList/ParameterListWrapAsNeeded.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/parameterList/ParameterListWrapAsNeeded.after.kt @@ -9,15 +9,15 @@ fun testtesttesttesttesttesttesttesttest() fun testtest(foofoo: Int) fun testtesttesttest( - foofoo: Int) + foofoo: Int +) fun test(foo: Int, bar: Int) fun testtesttesttest( - foofoo: Int, - barbar: Int, - foobar: Int, - barfoo: Int) + foofoo: Int, barbar: Int, + foobar: Int, barfoo: Int +) fun test() { for (foo: Int in bar) { @@ -41,27 +41,45 @@ 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) { - 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) { - constructor( - a: LongLongLongLongNameCLass, - b: LongLongLongLongNameCLass, - c: LongLongLongLongNameCLass) { + c: LongLongLongLongNameCLass + ) { } } -class C(sn1: ShorName, +class C( + sn1: ShorName, + sn2: ShorName, + sn3: ShorName, + sn4: ShorName, + sn5: ShorName, + sn6: ShorName, + sn6: ShorName, + sn8: ShorName, + sn9: ShorName +) { + constructor( + sn1: ShorName, sn2: ShorName, sn3: ShorName, sn4: ShorName, @@ -69,58 +87,53 @@ class C(sn1: ShorName, 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 + ) { } } -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) { - 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 + ) { } } -class E(longLongLongLongNameCLass1: LongLongLongLongNameCLass) { +class E( + longLongLongLongNameCLass1: LongLongLongLongNameCLass +) { constructor( - longLongLongLongNameCLass1: LongLongLongLongNameCLass) { + longLongLongLongNameCLass1: LongLongLongLongNameCLass + ) { } } -class F(a: LongLongLongLongNameCLass) { +class F( + a: LongLongLongLongNameCLass +) { constructor( - a: LongLongLongLongNameCLass) { + a: LongLongLongLongNameCLass + ) { } } class G(sn1: ShorName) { constructor( - sn1: ShorName) { + sn1: ShorName + ) { } } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/collectionLiteralExpression/CollectionLiteralInAnnotation.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/collectionLiteralExpression/CollectionLiteralInAnnotation.after.inv.kt index 0a3653bd881c..2680493f3028 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/collectionLiteralExpression/CollectionLiteralInAnnotation.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/collectionLiteralExpression/CollectionLiteralInAnnotation.after.inv.kt @@ -6,17 +6,23 @@ fun a() = Unit @Anno([1]) fun a() = Unit -@Anno([1 -]) +@Anno( + [1 + ] +) fun a() = Unit -@Anno([ - 1, -]) +@Anno( + [ + 1, + ] +) fun a() = Unit -@Anno([ - 1]) +@Anno( + [ + 1] +) fun a() = Unit @Anno([1, 2]) @@ -25,17 +31,23 @@ fun a() = Unit @Anno([1, 2]) fun a() = Unit -@Anno([1, 2 -]) +@Anno( + [1, 2 + ] +) fun a() = Unit -@Anno([ - 1, 2, -]) +@Anno( + [ + 1, 2, + ] +) fun a() = Unit -@Anno([ - 1, 2]) +@Anno( + [ + 1, 2] +) fun a() = Unit @Anno([1, 2, 2]) @@ -44,84 +56,112 @@ fun a() = Unit @Anno([1, 2, 2]) fun a() = Unit -@Anno(["1" -]) +@Anno( + ["1" + ] +) fun a() = Unit -@Anno([ - 1, -]) +@Anno( + [ + 1, + ] +) fun a() = Unit -@Anno([ - 1, 2, 2]) +@Anno( + [ + 1, 2, 2] +) fun a() = Unit -@Anno([1/* - */]) +@Anno( + [1/* + */] +) fun a() = Unit -@Anno([ - 1, //dw -]) +@Anno( + [ + 1, //dw + ] +) fun a() = Unit -@Anno([1 // ds -]) +@Anno( + [1 // ds + ] +) fun a() = Unit -@Anno([ - /* - */ // d - 1, - /* - */ - /* - */ -]) +@Anno( + [ + /* + */ // d + 1, + /* + */ + /* + */ + ] +) fun a() = Unit -@Anno([ - /* -*/ 1]) +@Anno( + [ + /* + */ 1] +) fun a() = Unit -@Anno([1/* - */, 2]) +@Anno( + [1/* + */, 2] +) fun a() = Unit -@Anno([ - 1, 2, - /* - */ - /* - */ -]) +@Anno( + [ + 1, 2, + /* + */ + /* + */ + ] +) fun a() = Unit -@Anno([/* +@Anno( + [/* */1, 2 -]) + ] +) fun a() = Unit -@Anno(["1" -]) +@Anno( + ["1" + ] +) fun a() = Unit -@Anno([ - 1, -]) +@Anno( + [ + 1, + ] +) fun a() = Unit -@Anno([ - 1, 2 /* - */]) +@Anno( + [ + 1, 2 /* + */] +) fun a() = Unit @Component( - modules = [ - AppModule::class, DataModule::class, - DomainModule::class - ], + modules = [ + AppModule::class, DataModule::class, + DomainModule::class + ], ) fun b() = Unit diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/collectionLiteralExpression/CollectionLiteralInAnnotation.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/collectionLiteralExpression/CollectionLiteralInAnnotation.after.kt index 0a3653bd881c..2680493f3028 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/collectionLiteralExpression/CollectionLiteralInAnnotation.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/collectionLiteralExpression/CollectionLiteralInAnnotation.after.kt @@ -6,17 +6,23 @@ fun a() = Unit @Anno([1]) fun a() = Unit -@Anno([1 -]) +@Anno( + [1 + ] +) fun a() = Unit -@Anno([ - 1, -]) +@Anno( + [ + 1, + ] +) fun a() = Unit -@Anno([ - 1]) +@Anno( + [ + 1] +) fun a() = Unit @Anno([1, 2]) @@ -25,17 +31,23 @@ fun a() = Unit @Anno([1, 2]) fun a() = Unit -@Anno([1, 2 -]) +@Anno( + [1, 2 + ] +) fun a() = Unit -@Anno([ - 1, 2, -]) +@Anno( + [ + 1, 2, + ] +) fun a() = Unit -@Anno([ - 1, 2]) +@Anno( + [ + 1, 2] +) fun a() = Unit @Anno([1, 2, 2]) @@ -44,84 +56,112 @@ fun a() = Unit @Anno([1, 2, 2]) fun a() = Unit -@Anno(["1" -]) +@Anno( + ["1" + ] +) fun a() = Unit -@Anno([ - 1, -]) +@Anno( + [ + 1, + ] +) fun a() = Unit -@Anno([ - 1, 2, 2]) +@Anno( + [ + 1, 2, 2] +) fun a() = Unit -@Anno([1/* - */]) +@Anno( + [1/* + */] +) fun a() = Unit -@Anno([ - 1, //dw -]) +@Anno( + [ + 1, //dw + ] +) fun a() = Unit -@Anno([1 // ds -]) +@Anno( + [1 // ds + ] +) fun a() = Unit -@Anno([ - /* - */ // d - 1, - /* - */ - /* - */ -]) +@Anno( + [ + /* + */ // d + 1, + /* + */ + /* + */ + ] +) fun a() = Unit -@Anno([ - /* -*/ 1]) +@Anno( + [ + /* + */ 1] +) fun a() = Unit -@Anno([1/* - */, 2]) +@Anno( + [1/* + */, 2] +) fun a() = Unit -@Anno([ - 1, 2, - /* - */ - /* - */ -]) +@Anno( + [ + 1, 2, + /* + */ + /* + */ + ] +) fun a() = Unit -@Anno([/* +@Anno( + [/* */1, 2 -]) + ] +) fun a() = Unit -@Anno(["1" -]) +@Anno( + ["1" + ] +) fun a() = Unit -@Anno([ - 1, -]) +@Anno( + [ + 1, + ] +) fun a() = Unit -@Anno([ - 1, 2 /* - */]) +@Anno( + [ + 1, 2 /* + */] +) fun a() = Unit @Component( - modules = [ - AppModule::class, DataModule::class, - DomainModule::class - ], + modules = [ + AppModule::class, DataModule::class, + DomainModule::class + ], ) fun b() = Unit diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/collectionLiteralExpression/CollectionLiteralInAnnotation.call.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/collectionLiteralExpression/CollectionLiteralInAnnotation.call.after.inv.kt index 0a3653bd881c..2680493f3028 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/collectionLiteralExpression/CollectionLiteralInAnnotation.call.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/collectionLiteralExpression/CollectionLiteralInAnnotation.call.after.inv.kt @@ -6,17 +6,23 @@ fun a() = Unit @Anno([1]) fun a() = Unit -@Anno([1 -]) +@Anno( + [1 + ] +) fun a() = Unit -@Anno([ - 1, -]) +@Anno( + [ + 1, + ] +) fun a() = Unit -@Anno([ - 1]) +@Anno( + [ + 1] +) fun a() = Unit @Anno([1, 2]) @@ -25,17 +31,23 @@ fun a() = Unit @Anno([1, 2]) fun a() = Unit -@Anno([1, 2 -]) +@Anno( + [1, 2 + ] +) fun a() = Unit -@Anno([ - 1, 2, -]) +@Anno( + [ + 1, 2, + ] +) fun a() = Unit -@Anno([ - 1, 2]) +@Anno( + [ + 1, 2] +) fun a() = Unit @Anno([1, 2, 2]) @@ -44,84 +56,112 @@ fun a() = Unit @Anno([1, 2, 2]) fun a() = Unit -@Anno(["1" -]) +@Anno( + ["1" + ] +) fun a() = Unit -@Anno([ - 1, -]) +@Anno( + [ + 1, + ] +) fun a() = Unit -@Anno([ - 1, 2, 2]) +@Anno( + [ + 1, 2, 2] +) fun a() = Unit -@Anno([1/* - */]) +@Anno( + [1/* + */] +) fun a() = Unit -@Anno([ - 1, //dw -]) +@Anno( + [ + 1, //dw + ] +) fun a() = Unit -@Anno([1 // ds -]) +@Anno( + [1 // ds + ] +) fun a() = Unit -@Anno([ - /* - */ // d - 1, - /* - */ - /* - */ -]) +@Anno( + [ + /* + */ // d + 1, + /* + */ + /* + */ + ] +) fun a() = Unit -@Anno([ - /* -*/ 1]) +@Anno( + [ + /* + */ 1] +) fun a() = Unit -@Anno([1/* - */, 2]) +@Anno( + [1/* + */, 2] +) fun a() = Unit -@Anno([ - 1, 2, - /* - */ - /* - */ -]) +@Anno( + [ + 1, 2, + /* + */ + /* + */ + ] +) fun a() = Unit -@Anno([/* +@Anno( + [/* */1, 2 -]) + ] +) fun a() = Unit -@Anno(["1" -]) +@Anno( + ["1" + ] +) fun a() = Unit -@Anno([ - 1, -]) +@Anno( + [ + 1, + ] +) fun a() = Unit -@Anno([ - 1, 2 /* - */]) +@Anno( + [ + 1, 2 /* + */] +) fun a() = Unit @Component( - modules = [ - AppModule::class, DataModule::class, - DomainModule::class - ], + modules = [ + AppModule::class, DataModule::class, + DomainModule::class + ], ) fun b() = Unit diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/collectionLiteralExpression/CollectionLiteralInAnnotation.call.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/collectionLiteralExpression/CollectionLiteralInAnnotation.call.after.kt index 9da634f19a30..9dd36ef8e6a8 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/collectionLiteralExpression/CollectionLiteralInAnnotation.call.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/collectionLiteralExpression/CollectionLiteralInAnnotation.call.after.kt @@ -7,23 +7,23 @@ fun a() = Unit fun a() = Unit @Anno( - [ - 1, - ], + [ + 1, + ], ) fun a() = Unit @Anno( - [ - 1, - ], + [ + 1, + ], ) fun a() = Unit @Anno( - [ - 1, - ], + [ + 1, + ], ) fun a() = Unit @@ -34,23 +34,23 @@ fun a() = Unit fun a() = Unit @Anno( - [ - 1, 2, - ], + [ + 1, 2, + ], ) fun a() = Unit @Anno( - [ - 1, 2, - ], + [ + 1, 2, + ], ) fun a() = Unit @Anno( - [ - 1, 2, - ], + [ + 1, 2, + ], ) fun a() = Unit @@ -61,128 +61,128 @@ fun a() = Unit fun a() = Unit @Anno( - [ - "1", - ], + [ + "1", + ], ) fun a() = Unit @Anno( - [ - 1, - ], + [ + 1, + ], ) fun a() = Unit @Anno( - [ - 1, 2, 2, - ], + [ + 1, 2, 2, + ], ) fun a() = Unit @Anno( - [ - 1, - /* - */ - ], + [ + 1, + /* + */ + ], ) fun a() = Unit @Anno( - [ - 1, //dw - ], + [ + 1, //dw + ], ) fun a() = Unit @Anno( - [ - 1, // ds - ], + [ + 1, // ds + ], ) fun a() = Unit @Anno( - [ - /* - */ // d - 1, - /* - */ - /* - */ - ], + [ + /* + */ // d + 1, + /* + */ + /* + */ + ], ) fun a() = Unit @Anno( - [ - /* - */ - 1, - ], + [ + /* + */ + 1, + ], ) fun a() = Unit @Anno( - [ - 1, - /* - */ - 2, - ], + [ + 1, + /* + */ + 2, + ], ) fun a() = Unit @Anno( - [ - 1, 2, - /* - */ - /* - */ - ], + [ + 1, 2, + /* + */ + /* + */ + ], ) fun a() = Unit @Anno( - [ - /* - */ - 1, 2, - ], + [ + /* + */ + 1, 2, + ], ) fun a() = Unit @Anno( - [ - "1", - ], + [ + "1", + ], ) fun a() = Unit @Anno( - [ - 1, - ], + [ + 1, + ], ) fun a() = Unit @Anno( - [ - 1, 2, - /* - */ - ], + [ + 1, 2, + /* + */ + ], ) fun a() = Unit @Component( - modules = [ - AppModule::class, DataModule::class, - DomainModule::class, - ], + modules = [ + AppModule::class, DataModule::class, + DomainModule::class, + ], ) fun b() = Unit diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/destructuringDeclarations/DestructuringDeclarationsInLambda.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/destructuringDeclarations/DestructuringDeclarationsInLambda.after.inv.kt index b2a44c4eda13..40923705b66a 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/destructuringDeclarations/DestructuringDeclarationsInLambda.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/destructuringDeclarations/DestructuringDeclarationsInLambda.after.inv.kt @@ -9,40 +9,40 @@ val x: (Pair, Int) -> Unit = { (x, y), z -> } val x: (Pair, Int) -> Unit = { - (x, + (x, y), - z, + z, -> println(x) } val x: (Pair, Int) -> Unit = { - ( + ( x, y), - z, + z, -> println(x) } val x: (Pair, Int) -> Unit = { - ( + ( x, // adw y, - ), - z, + ), + z, -> println(x) } val x: (Pair, Int) -> Unit = { - ( + ( x, - /* val x: (Pair, Int) -> Unit = { (x, y), z, -> - println(x) - }*/ - ), - z, + /* val x: (Pair, Int) -> Unit = { (x, y), z, -> + println(x) +}*/ + ), + z, -> println(x) } @@ -56,36 +56,36 @@ val x: (Pair, Int) -> Unit = { (x, y/**/), z -> } val x: (Pair, Int) -> Unit = { - (x, y/* + (x, y/* */), - z, + z, -> println(x) } val x: (Pair, Int) -> Unit = { - (/**/x /**/ /* + (/**/x /**/ /* */, // awdawd y/* */), - z, + z, -> println(x) } val x: (Pair, Int) -> Unit = { - (/**/x /**/ /* + (/**/x /**/ /* */, // awdawd y/* */), - z, + z, -> println(x) } val x: (Pair, Int) -> Unit = { - (x, y), - z, + (x, y), + z, -> println(x) } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/destructuringDeclarations/DestructuringDeclarationsInLambda.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/destructuringDeclarations/DestructuringDeclarationsInLambda.after.kt index b3e895232cb3..70a4ccba7b6c 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/destructuringDeclarations/DestructuringDeclarationsInLambda.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/destructuringDeclarations/DestructuringDeclarationsInLambda.after.kt @@ -9,43 +9,43 @@ val x: (Pair, Int) -> Unit = { (x, y), z -> } val x: (Pair, Int) -> Unit = { - ( + ( x, y, - ), - z, + ), + z, -> println(x) } val x: (Pair, Int) -> Unit = { - ( + ( x, y, - ), - z, + ), + z, -> println(x) } val x: (Pair, Int) -> Unit = { - ( + ( x, // adw y, - ), - z, + ), + z, -> println(x) } val x: (Pair, Int) -> Unit = { - ( + ( x, - /* val x: (Pair, Int) -> Unit = { (x, y), z, -> - println(x) - }*/ - ), - z, + /* val x: (Pair, Int) -> Unit = { (x, y), z, -> + println(x) +}*/ + ), + z, -> println(x) } @@ -59,47 +59,47 @@ val x: (Pair, Int) -> Unit = { (x, y/**/), z -> } val x: (Pair, Int) -> Unit = { - ( + ( x, y, - /* - */ - ), - z, + /* +*/ + ), + z, -> println(x) } val x: (Pair, Int) -> Unit = { - ( - /**/x, /**/ - /* - */ // awdawd + ( + /**/x, /**/ + /* +*/ // awdawd y, - /* - */ - ), - z, + /* +*/ + ), + z, -> println(x) } val x: (Pair, Int) -> Unit = { - ( - /**/x, /**/ - /* - */ // awdawd + ( + /**/x, /**/ + /* +*/ // awdawd y, - /* - */ - ), - z, + /* +*/ + ), + z, -> println(x) } val x: (Pair, Int) -> Unit = { - (x, y), - z, + (x, y), + z, -> println(x) } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/destructuringDeclarations/MultiVariableDeclaration.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/destructuringDeclarations/MultiVariableDeclaration.after.inv.kt index 27c551b6bf77..d2ec1ef0ed34 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/destructuringDeclarations/MultiVariableDeclaration.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/destructuringDeclarations/MultiVariableDeclaration.after.inv.kt @@ -14,44 +14,44 @@ fun test() { val (a, b) = 1 to 2 val (a) = - b + b val ( - a, + a, ) = - b + b val (a ) = - b + b val (a) = b val ( - a, + a, ) = b val (a, b ) = 1 to 2 val (a, - b) = 1 to 2 + b) = 1 to 2 val ( - a, b + a, b ) = 1 to 2 val ( - a, b, + a, b, ) = 1 to 2 val (a, b, c, - d, f + d, f ) = 1 to 2 val ( - a, b, c, - d, f, + a, b, c, + d, f, ) = 1 to 2 val (a, b/**/) = 1 to 2 @@ -68,7 +68,7 @@ fun test() { val (a/**/, b/**//**/) = 1 to 2 val (a/**//**/) = - b + b val (a) = b @@ -85,20 +85,20 @@ fun test() { /**/b) = 1 to 2 val ( - a, b // fe + a, b // fe /**/)/**/ = 1 to 2 val ( - a, b, // awd + a, b, // awd ) = 1 to 2 val (a, b, c, - d, f // awd + d, f // awd /* */) = 1 to 2 val ( - a, b, c, - d, f, // awd + a, b, c, + d, f, // awd ) = 1 to 2 -} \ No newline at end of file +} diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/destructuringDeclarations/MultiVariableDeclaration.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/destructuringDeclarations/MultiVariableDeclaration.after.kt index 81830cd0f6e0..5f1aed77b36d 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/destructuringDeclarations/MultiVariableDeclaration.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/destructuringDeclarations/MultiVariableDeclaration.after.kt @@ -14,49 +14,49 @@ fun test() { val (a, b) = 1 to 2 val (a) = - b + b val ( - a, + a, ) = - b + b val ( - a, + a, ) = - b + b val (a) = b val ( - a, + a, ) = b val ( - a, b, + a, b, ) = 1 to 2 val ( - a, - b, + a, + b, ) = 1 to 2 val ( - a, b, + a, b, ) = 1 to 2 val ( - a, b, + a, b, ) = 1 to 2 val ( - a, b, c, - d, f, + a, b, c, + d, f, ) = 1 to 2 val ( - a, b, c, - d, f, + a, b, c, + d, f, ) = 1 to 2 val (a, b/**/) = 1 to 2 @@ -73,45 +73,45 @@ fun test() { val (a/**/, b/**//**/) = 1 to 2 val (a/**//**/) = - b + b val (a) = b val ( - a, b,/**/ + a, b,/**/ ) = 1 to 2 val ( - a, b,// awd + a, b,// awd ) = 1 to 2 val ( - a,/**/ b, /**/ // awd + a,/**/ b, /**/ // awd ) = 1 to 2 val ( - a, // ad + a, // ad /**/b, ) = 1 to 2 val ( - a, b, // fe + a, b, // fe /**/ )/**/ = 1 to 2 val ( - a, b, // awd + a, b, // awd ) = 1 to 2 val ( - a, b, c, - d, f, // awd + a, b, c, + d, f, // awd /* */ ) = 1 to 2 val ( - a, b, c, - d, f, // awd + a, b, c, + d, f, // awd ) = 1 to 2 } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/enumEntry/Enum.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/enumEntry/Enum.after.inv.kt index 297c668ec17f..2903b0613a89 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/enumEntry/Enum.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/enumEntry/Enum.after.inv.kt @@ -23,21 +23,21 @@ enum class Enum5 { enum class Enum6(val a: Int) { A( - 1 + 1 ), B, } enum class Enum7(val a: Int) { A( - 1 + 1 ), B, ; } enum class Enum8(val a: Int) { A( - 1 + 1 ), B; -} \ No newline at end of file +} diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/enumEntry/Enum.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/enumEntry/Enum.after.kt index 6d80aa1b8325..2265713d4537 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/enumEntry/Enum.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/enumEntry/Enum.after.kt @@ -24,14 +24,14 @@ enum class Enum5 { enum class Enum6(val a: Int) { A( - 1 + 1 ), B, } enum class Enum7(val a: Int) { A( - 1 + 1 ), B, ; @@ -39,7 +39,7 @@ enum class Enum7(val a: Int) { enum class Enum8(val a: Int) { A( - 1 + 1 ), B; -} \ No newline at end of file +} diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/indices/IndicesAccess.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/indices/IndicesAccess.after.inv.kt index 0d968b2003e6..8ab35699c419 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/indices/IndicesAccess.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/indices/IndicesAccess.after.inv.kt @@ -191,7 +191,7 @@ fun foo() { testtest[ foofoo, fososos, /* - */ + */ testtest[testtest[foofoo]], ] diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/indices/IndicesAccess.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/indices/IndicesAccess.after.kt index 0d968b2003e6..8ab35699c419 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/indices/IndicesAccess.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/indices/IndicesAccess.after.kt @@ -191,7 +191,7 @@ fun foo() { testtest[ foofoo, fososos, /* - */ + */ testtest[testtest[foofoo]], ] diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/indices/IndicesAccess.call.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/indices/IndicesAccess.call.after.inv.kt index cf19e1b4812d..8ab35699c419 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/indices/IndicesAccess.call.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/indices/IndicesAccess.call.after.inv.kt @@ -191,7 +191,7 @@ fun foo() { testtest[ foofoo, fososos, /* - */ + */ testtest[testtest[foofoo]], ] @@ -215,4 +215,4 @@ fun foo() { useCallable[Callable { println["Hello world"] } // ffd ] -} \ No newline at end of file +} diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/indices/IndicesAccess.call.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/indices/IndicesAccess.call.after.kt index 5e37f0a91bfa..d3dc8610fd9f 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/indices/IndicesAccess.call.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/indices/IndicesAccess.call.after.kt @@ -180,24 +180,24 @@ fun foo() { foofoo, foofoo, foofoo, foofoo, bar, /* - */ + */ /* */ foo, ] testtest[ /* - */ + */ foofoo, foofoo, foofoo, /* - */ + */ foofoo, bar, ] testtest[ foofoo, foofoo, foofoo, foofoo, bar, /* - */ + */ ] testtest[ @@ -208,7 +208,7 @@ fun foo() { foofoo, foofoo, foofoo, foofoo, /* - */ + */ bar, ] @@ -226,7 +226,7 @@ fun foo() { testtest[ foofoo, foofoo, foofoo, foofoo, /* - */ + */ /* */ bar, ] @@ -244,7 +244,7 @@ fun foo() { testtest[ foofoo, fososos, /* - */ + */ testtest[testtest[foofoo]], ] @@ -255,7 +255,7 @@ fun foo() { testtest[ foofoo, testtest[testtest[foofoo]], /* - */ + */ testsa, ] @@ -264,7 +264,7 @@ fun foo() { testtest[ foofoo, seee, testtest[testtest[foofoo]], /* - */ + */ testsa, ] diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/lambdaParameters/LambdaParameterList.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/lambdaParameters/LambdaParameterList.after.inv.kt index 794656815ff8..4857ef1e43a9 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/lambdaParameters/LambdaParameterList.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/lambdaParameters/LambdaParameterList.after.inv.kt @@ -1,6 +1,6 @@ val x = { - x: Comparable>, - y: String, + x: Comparable>, + y: String, -> println("1") } @@ -21,23 +21,23 @@ val x = { x: String, } val x = { - x: String, - y: Comparable>, + x: String, + y: Comparable>, -> println("1") } val x = { - x: Comparable>, - y: String, + x: Comparable>, + y: String, -> println("1") } val x = { - x: String, - y: Comparable>, - z: String, + x: String, + y: Comparable>, + z: String, -> println("1") } @@ -50,23 +50,23 @@ val x = { x: String, } val x = { - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, -> println("1") } val x = { - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, -> println("1") } val x = { - x: String, + x: String, -> println("1") } @@ -81,14 +81,14 @@ val x = { x: String -> } val x = { - x: String, + x: String, -> println("1") } val x = { - x: String, - y: String, + x: String, + y: String, -> println("1") } @@ -100,23 +100,23 @@ val x = { x: String, } val x = { - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, -> println("1") } val x = { - x: String, - z: String, + x: String, + z: String, -> println("1") } val x = { - x, y: String, - z: String, + x, y: String, + z: String, -> println("1") } @@ -127,15 +127,15 @@ val x = { x: String, y: String, z: String } val x = { - z: String, v: Comparable>, + z: String, v: Comparable>, -> println("1") } val x = { - x: String, - y: Comparable>, + x: String, + y: Comparable>, -> println("1") } @@ -157,26 +157,26 @@ val x = { x: String, y: String }() val x = { - x: String, - /* - */ - y: String, - z: String, + x: String, + /* + */ + y: String, + z: String, -> println("1") } val x = { - x: String, y: String, z: String, - /* - */ + x: String, y: String, z: String, + /* + */ -> println("1") } val x = { - x: Comparable>, y: String, - z: String, + x: Comparable>, y: String, + z: String, -> println("1") } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/lambdaParameters/LambdaParameterList.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/lambdaParameters/LambdaParameterList.after.kt index 239fc075d781..e76e2b8fdea9 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/lambdaParameters/LambdaParameterList.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/lambdaParameters/LambdaParameterList.after.kt @@ -1,6 +1,6 @@ val x = { - x: Comparable>, - y: String, + x: Comparable>, + y: String, -> println("1") } @@ -10,74 +10,74 @@ val x = { x: Comparable>, y: String -> } val x = { - x: String, - y - : String, + x: String, + y + : String, -> println("1") } val x = { - x: String, - y: String, + x: String, + y: String, -> println("1") } val x = { - x: String, - y: Comparable>, + x: String, + y: Comparable>, -> println("1") } val x = { - x: Comparable>, - y: String, + x: Comparable>, + y: String, -> println("1") } val x = { - x: String, - y: Comparable>, - z: String, + x: String, + y: Comparable>, + z: String, -> println("1") } val x = { - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, -> println("1") } val x = { - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, -> println("1") } val x = { - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, -> println("1") } val x = { - x: String, + x: String, -> println("1") } val x = { - x: String, + x: String, -> println("1") } @@ -87,114 +87,114 @@ val x = { x: String -> } val x = { - x: String, + x: String, -> println("1") } val x = { - x: String, - y: String, + x: String, + y: String, -> println("1") } val x = { - x: String, - z: String, + x: String, + z: String, -> println("1") } val x = { - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, -> println("1") } val x = { - x: String, - z: String, + x: String, + z: String, -> println("1") } val x = { - x, y: String, - z: String, + x, y: String, + z: String, -> println("1") } val x = { - x: String, y: String, z: String, + x: String, y: String, z: String, -> println("1") } val x = { - z: String, v: Comparable>, + z: String, v: Comparable>, -> println("1") } val x = { - x: String, - y: Comparable>, + x: String, + y: Comparable>, -> println("1") } val x = { - x: Int, + x: Int, -> println("1") } val x = { - x: String, y: String, - /* */ z: String, + x: String, y: String, + /* */ z: String, -> println("1") } val x = { - x: String, y: String, - /* */ /* */ z: String, + x: String, y: String, + /* */ /* */ z: String, -> println("1") }() val x = { - x: String, - /* - */ - y: String, - z: String, + x: String, + /* + */ + y: String, + z: String, -> println("1") } val x = { - x: String, y: String, z: String, - /* - */ + x: String, y: String, z: String, + /* + */ -> println("1") } val x = { - x: Comparable>, y: String, - z: String, + x: Comparable>, y: String, + z: String, -> println("1") } val x = { - x: String, y: String, z: String, + x: String, y: String, z: String, -> println("1") } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/lambdaParameters/LambdaParameterList.call.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/lambdaParameters/LambdaParameterList.call.after.inv.kt index 794656815ff8..4857ef1e43a9 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/lambdaParameters/LambdaParameterList.call.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/lambdaParameters/LambdaParameterList.call.after.inv.kt @@ -1,6 +1,6 @@ val x = { - x: Comparable>, - y: String, + x: Comparable>, + y: String, -> println("1") } @@ -21,23 +21,23 @@ val x = { x: String, } val x = { - x: String, - y: Comparable>, + x: String, + y: Comparable>, -> println("1") } val x = { - x: Comparable>, - y: String, + x: Comparable>, + y: String, -> println("1") } val x = { - x: String, - y: Comparable>, - z: String, + x: String, + y: Comparable>, + z: String, -> println("1") } @@ -50,23 +50,23 @@ val x = { x: String, } val x = { - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, -> println("1") } val x = { - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, -> println("1") } val x = { - x: String, + x: String, -> println("1") } @@ -81,14 +81,14 @@ val x = { x: String -> } val x = { - x: String, + x: String, -> println("1") } val x = { - x: String, - y: String, + x: String, + y: String, -> println("1") } @@ -100,23 +100,23 @@ val x = { x: String, } val x = { - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, -> println("1") } val x = { - x: String, - z: String, + x: String, + z: String, -> println("1") } val x = { - x, y: String, - z: String, + x, y: String, + z: String, -> println("1") } @@ -127,15 +127,15 @@ val x = { x: String, y: String, z: String } val x = { - z: String, v: Comparable>, + z: String, v: Comparable>, -> println("1") } val x = { - x: String, - y: Comparable>, + x: String, + y: Comparable>, -> println("1") } @@ -157,26 +157,26 @@ val x = { x: String, y: String }() val x = { - x: String, - /* - */ - y: String, - z: String, + x: String, + /* + */ + y: String, + z: String, -> println("1") } val x = { - x: String, y: String, z: String, - /* - */ + x: String, y: String, z: String, + /* + */ -> println("1") } val x = { - x: Comparable>, y: String, - z: String, + x: Comparable>, y: String, + z: String, -> println("1") } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/lambdaParameters/LambdaParameterList.call.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/lambdaParameters/LambdaParameterList.call.after.kt index 239fc075d781..e76e2b8fdea9 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/lambdaParameters/LambdaParameterList.call.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/lambdaParameters/LambdaParameterList.call.after.kt @@ -1,6 +1,6 @@ val x = { - x: Comparable>, - y: String, + x: Comparable>, + y: String, -> println("1") } @@ -10,74 +10,74 @@ val x = { x: Comparable>, y: String -> } val x = { - x: String, - y - : String, + x: String, + y + : String, -> println("1") } val x = { - x: String, - y: String, + x: String, + y: String, -> println("1") } val x = { - x: String, - y: Comparable>, + x: String, + y: Comparable>, -> println("1") } val x = { - x: Comparable>, - y: String, + x: Comparable>, + y: String, -> println("1") } val x = { - x: String, - y: Comparable>, - z: String, + x: String, + y: Comparable>, + z: String, -> println("1") } val x = { - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, -> println("1") } val x = { - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, -> println("1") } val x = { - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, -> println("1") } val x = { - x: String, + x: String, -> println("1") } val x = { - x: String, + x: String, -> println("1") } @@ -87,114 +87,114 @@ val x = { x: String -> } val x = { - x: String, + x: String, -> println("1") } val x = { - x: String, - y: String, + x: String, + y: String, -> println("1") } val x = { - x: String, - z: String, + x: String, + z: String, -> println("1") } val x = { - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, -> println("1") } val x = { - x: String, - z: String, + x: String, + z: String, -> println("1") } val x = { - x, y: String, - z: String, + x, y: String, + z: String, -> println("1") } val x = { - x: String, y: String, z: String, + x: String, y: String, z: String, -> println("1") } val x = { - z: String, v: Comparable>, + z: String, v: Comparable>, -> println("1") } val x = { - x: String, - y: Comparable>, + x: String, + y: Comparable>, -> println("1") } val x = { - x: Int, + x: Int, -> println("1") } val x = { - x: String, y: String, - /* */ z: String, + x: String, y: String, + /* */ z: String, -> println("1") } val x = { - x: String, y: String, - /* */ /* */ z: String, + x: String, y: String, + /* */ /* */ z: String, -> println("1") }() val x = { - x: String, - /* - */ - y: String, - z: String, + x: String, + /* + */ + y: String, + z: String, -> println("1") } val x = { - x: String, y: String, z: String, - /* - */ + x: String, y: String, z: String, + /* + */ -> println("1") } val x = { - x: Comparable>, y: String, - z: String, + x: Comparable>, y: String, + z: String, -> println("1") } val x = { - x: String, y: String, z: String, + x: String, y: String, z: String, -> println("1") } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeArguments/TypeArgumentList.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeArguments/TypeArgumentList.after.inv.kt index ec6a1279d315..75340f3a5fce 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeArguments/TypeArgumentList.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeArguments/TypeArgumentList.after.inv.kt @@ -98,7 +98,7 @@ fun foo() { testtest< foofoo, /* - */ + */ >() testtest< @@ -108,7 +108,7 @@ fun foo() { testtest< foofoo, fososos, /* - */ + */ testtest>, >() diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeArguments/TypeArgumentList.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeArguments/TypeArgumentList.after.kt index ec6a1279d315..75340f3a5fce 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeArguments/TypeArgumentList.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeArguments/TypeArgumentList.after.kt @@ -98,7 +98,7 @@ fun foo() { testtest< foofoo, /* - */ + */ >() testtest< @@ -108,7 +108,7 @@ fun foo() { testtest< foofoo, fososos, /* - */ + */ testtest>, >() diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeArguments/TypeArgumentList.call.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeArguments/TypeArgumentList.call.after.inv.kt index ec6a1279d315..75340f3a5fce 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeArguments/TypeArgumentList.call.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeArguments/TypeArgumentList.call.after.inv.kt @@ -98,7 +98,7 @@ fun foo() { testtest< foofoo, /* - */ + */ >() testtest< @@ -108,7 +108,7 @@ fun foo() { testtest< foofoo, fososos, /* - */ + */ testtest>, >() diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeArguments/TypeArgumentList.call.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeArguments/TypeArgumentList.call.after.kt index 7345692f1b01..a61e74c28098 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeArguments/TypeArgumentList.call.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeArguments/TypeArgumentList.call.after.kt @@ -59,24 +59,24 @@ fun foo() { foofoo, foofoo, foofoo, foofoo, bar, /* - */ + */ /* */ foo, >() testtest< /* - */ + */ foofoo, foofoo, foofoo, /* - */ + */ foofoo, bar, >() testtest< foofoo, foofoo, foofoo, foofoo, bar, /* - */ + */ >() testtest< @@ -87,7 +87,7 @@ fun foo() { foofoo, foofoo, foofoo, foofoo, /* - */ + */ bar, >() @@ -105,7 +105,7 @@ fun foo() { testtest< foofoo, foofoo, foofoo, foofoo, /* - */ + */ /* */ bar, >() @@ -123,7 +123,7 @@ fun foo() { testtest< foofoo, /* - */ + */ >() testtest< @@ -133,7 +133,7 @@ fun foo() { testtest< foofoo, fososos, /* - */ + */ testtest>, >() @@ -144,7 +144,7 @@ fun foo() { testtest< foofoo, testtest>, /* - */ + */ testsa, >() @@ -153,7 +153,7 @@ fun foo() { testtest< foofoo, seee, testtest>, /* - */ + */ testsa, >() } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeParameters/TypeParameterList.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeParameters/TypeParameterList.after.inv.kt index cbe664ca8066..b5688e59c738 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeParameters/TypeParameterList.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeParameters/TypeParameterList.after.inv.kt @@ -218,7 +218,7 @@ class G< class H< x : String, /* - */ + */ y : String, z : String, > @@ -226,7 +226,7 @@ class H< class J< x : String, y : String, z : String, /* - */ + */ > class K< @@ -254,17 +254,17 @@ class G< class H< x : String, /* - */ + */ y : String, z : String, /* - */ + */ > class J< x : String, y : String, z : String, /* - */ + */ /**/ > diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeParameters/TypeParameterList.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeParameters/TypeParameterList.after.kt index fcda379061c8..e052addb5987 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeParameters/TypeParameterList.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeParameters/TypeParameterList.after.kt @@ -224,7 +224,7 @@ class G< class H< x : String, /* - */ + */ y : String, z : String, > @@ -232,7 +232,7 @@ class H< class J< x : String, y : String, z : String, /* - */ + */ > class K< @@ -261,17 +261,17 @@ class G< class H< x : String, /* - */ + */ y : String, z : String, /* - */ + */ > class J< x : String, y : String, z : String, /* - */ + */ /**/ > diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeParameters/TypeParameterList.call.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeParameters/TypeParameterList.call.after.inv.kt index cbe664ca8066..b5688e59c738 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeParameters/TypeParameterList.call.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeParameters/TypeParameterList.call.after.inv.kt @@ -218,7 +218,7 @@ class G< class H< x : String, /* - */ + */ y : String, z : String, > @@ -226,7 +226,7 @@ class H< class J< x : String, y : String, z : String, /* - */ + */ > class K< @@ -254,17 +254,17 @@ class G< class H< x : String, /* - */ + */ y : String, z : String, /* - */ + */ > class J< x : String, y : String, z : String, /* - */ + */ /**/ > diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeParameters/TypeParameterList.call.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeParameters/TypeParameterList.call.after.kt index fcda379061c8..e052addb5987 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeParameters/TypeParameterList.call.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/typeParameters/TypeParameterList.call.after.kt @@ -224,7 +224,7 @@ class G< class H< x : String, /* - */ + */ y : String, z : String, > @@ -232,7 +232,7 @@ class H< class J< x : String, y : String, z : String, /* - */ + */ > class K< @@ -261,17 +261,17 @@ class G< class H< x : String, /* - */ + */ y : String, z : String, /* - */ + */ > class J< x : String, y : String, z : String, /* - */ + */ /**/ > diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListChopAsNeeded.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListChopAsNeeded.after.inv.kt index 839e243dae68..511bc0b2afb7 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListChopAsNeeded.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListChopAsNeeded.after.inv.kt @@ -2,28 +2,34 @@ // SET_TRUE: ALLOW_TRAILING_COMMA fun foo() { - testtest(foofoo, foofoo, foofoo, - foofoo, bar) - testtest( - foofoo, foofoo, foofoo, foofoo, bar - ) - - testtest(foofoo, foofoo, foofoo, foofoo, bar - ) - - testtest(foofoo, foofoo, foofoo, foofoo, - bar - ) - - testtest(foofoo + foofoo, foofoo, foofoo, + foofoo, bar ) testtest( - foofoo) + foofoo, foofoo, foofoo, foofoo, bar + ) testtest( - foofoo + foofoo, foofoo, foofoo, foofoo, bar + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, + bar + ) + + testtest( + foofoo + ) + + testtest( + foofoo + ) + + testtest( + foofoo ) testtest(foofoo) @@ -56,7 +62,7 @@ fun foo() { } useCallable( - Callable { println("Hello world") }) + Callable { println("Hello world") }) useCallable("A", { println("Hello world") }) @@ -78,7 +84,7 @@ fun foo() { } useCallable( - { println("Hello world") }) + { println("Hello world") }) useCallable("A", foo() { println("Hello world") }) @@ -100,7 +106,7 @@ fun foo() { } useCallable( - foo() { println("Hello world") }) + foo() { println("Hello world") }) useCallable("A", object : Callable { override fun call() { @@ -129,11 +135,11 @@ fun foo() { }) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, + object : Callable { + override fun call() { + println("Hello world") + } + }, ) useCallable(object : Callable { @@ -152,15 +158,15 @@ fun foo() { } useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }) + object : Callable { + override fun call() { + println("Hello world") + } + }) testtest( - foofoo, foofoo, foofoo, foofoo, - bar /* + foofoo, foofoo, foofoo, foofoo, + bar /* */, /* */ foo ) @@ -168,60 +174,72 @@ fun foo() { */foofoo, foofoo, foofoo, /* */ - foofoo, bar) - - testtest(foofoo, foofoo, foofoo, foofoo, bar/* - */) - - testtest(foofoo, foofoo, foofoo, foofoo, bar // awdawda + foofoo, bar ) - testtest(foofoo, foofoo, foofoo, foofoo, /* + testtest( + foofoo, foofoo, foofoo, foofoo, bar/* + */ + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, bar // awdawda + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, /* */ - bar + bar ) - testtest(foofoo // fd + testtest( + foofoo // fd ) testtest( /**/ - foofoo - ) - - testtest(foofoo/**/) - - testtest(foofoo, foofoo, foofoo, foofoo/* - */, /* */ bar - ) - - testtest(foofoo // fd - ) - - testtest( /**/ - foofoo + foofoo ) testtest(foofoo/**/) testtest( - foofoo, fososos, - /* - */ - testtest(testtest(foofoo)), + foofoo, foofoo, foofoo, foofoo/* + */, /* */ bar + ) + + testtest( + foofoo // fd + ) + + testtest( /**/ + foofoo + ) + + testtest(foofoo/**/) + + testtest( + foofoo, fososos, + /* + */ + testtest(testtest(foofoo)), ) testtest(foofoo, testtest(testtest(foofoo)), /**/testsa) testtest(foofoo, testtest(testtest(foofoo))/* */, /**/testsa) - testtest(foofoo, testtest(testtest(foofoo))/* - */, testsa) + testtest( + foofoo, testtest(testtest(foofoo))/* + */, testsa + ) testtest(foofoo, seee, testtest(testtest(foofoo)), /**/testsa) - testtest(foofoo, seee, testtest(testtest(foofoo)), /* - */testsa) + testtest( + foofoo, seee, testtest(testtest(foofoo)), /* + */testsa + ) useCallable("B", "C", Callable { println("Hello world") @@ -233,46 +251,50 @@ fun foo() { ) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, - ) - - useCallable( - foo() { + object : Callable { + override fun call() { println("Hello world") - }, + } + }, ) useCallable( - { - println("Hello world") - }, + foo() { + println("Hello world") + }, ) useCallable( - Callable { println("Hello world") }, + { + println("Hello world") + }, ) - testtest(foofoo, testtest(testtest( - foofoo, - )), testsa) + useCallable( + Callable { println("Hello world") }, + ) testtest( - foofoo, fososos, testtest(testtest(foofoo)), + foofoo, testtest( + testtest( + foofoo, + ) + ), testsa + ) + + testtest( + foofoo, fososos, testtest(testtest(foofoo)), ) } fun test() { baz( - f = fun(it: Int): String = "$it", - /*dwdwd + f = fun(it: Int): String = "$it", + /*dwdwd + */ + name = "", + /* */ - name = "", - /* - */ ) } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListChopAsNeeded.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListChopAsNeeded.after.kt index 839e243dae68..511bc0b2afb7 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListChopAsNeeded.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListChopAsNeeded.after.kt @@ -2,28 +2,34 @@ // SET_TRUE: ALLOW_TRAILING_COMMA fun foo() { - testtest(foofoo, foofoo, foofoo, - foofoo, bar) - testtest( - foofoo, foofoo, foofoo, foofoo, bar - ) - - testtest(foofoo, foofoo, foofoo, foofoo, bar - ) - - testtest(foofoo, foofoo, foofoo, foofoo, - bar - ) - - testtest(foofoo + foofoo, foofoo, foofoo, + foofoo, bar ) testtest( - foofoo) + foofoo, foofoo, foofoo, foofoo, bar + ) testtest( - foofoo + foofoo, foofoo, foofoo, foofoo, bar + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, + bar + ) + + testtest( + foofoo + ) + + testtest( + foofoo + ) + + testtest( + foofoo ) testtest(foofoo) @@ -56,7 +62,7 @@ fun foo() { } useCallable( - Callable { println("Hello world") }) + Callable { println("Hello world") }) useCallable("A", { println("Hello world") }) @@ -78,7 +84,7 @@ fun foo() { } useCallable( - { println("Hello world") }) + { println("Hello world") }) useCallable("A", foo() { println("Hello world") }) @@ -100,7 +106,7 @@ fun foo() { } useCallable( - foo() { println("Hello world") }) + foo() { println("Hello world") }) useCallable("A", object : Callable { override fun call() { @@ -129,11 +135,11 @@ fun foo() { }) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, + object : Callable { + override fun call() { + println("Hello world") + } + }, ) useCallable(object : Callable { @@ -152,15 +158,15 @@ fun foo() { } useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }) + object : Callable { + override fun call() { + println("Hello world") + } + }) testtest( - foofoo, foofoo, foofoo, foofoo, - bar /* + foofoo, foofoo, foofoo, foofoo, + bar /* */, /* */ foo ) @@ -168,60 +174,72 @@ fun foo() { */foofoo, foofoo, foofoo, /* */ - foofoo, bar) - - testtest(foofoo, foofoo, foofoo, foofoo, bar/* - */) - - testtest(foofoo, foofoo, foofoo, foofoo, bar // awdawda + foofoo, bar ) - testtest(foofoo, foofoo, foofoo, foofoo, /* + testtest( + foofoo, foofoo, foofoo, foofoo, bar/* + */ + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, bar // awdawda + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, /* */ - bar + bar ) - testtest(foofoo // fd + testtest( + foofoo // fd ) testtest( /**/ - foofoo - ) - - testtest(foofoo/**/) - - testtest(foofoo, foofoo, foofoo, foofoo/* - */, /* */ bar - ) - - testtest(foofoo // fd - ) - - testtest( /**/ - foofoo + foofoo ) testtest(foofoo/**/) testtest( - foofoo, fososos, - /* - */ - testtest(testtest(foofoo)), + foofoo, foofoo, foofoo, foofoo/* + */, /* */ bar + ) + + testtest( + foofoo // fd + ) + + testtest( /**/ + foofoo + ) + + testtest(foofoo/**/) + + testtest( + foofoo, fososos, + /* + */ + testtest(testtest(foofoo)), ) testtest(foofoo, testtest(testtest(foofoo)), /**/testsa) testtest(foofoo, testtest(testtest(foofoo))/* */, /**/testsa) - testtest(foofoo, testtest(testtest(foofoo))/* - */, testsa) + testtest( + foofoo, testtest(testtest(foofoo))/* + */, testsa + ) testtest(foofoo, seee, testtest(testtest(foofoo)), /**/testsa) - testtest(foofoo, seee, testtest(testtest(foofoo)), /* - */testsa) + testtest( + foofoo, seee, testtest(testtest(foofoo)), /* + */testsa + ) useCallable("B", "C", Callable { println("Hello world") @@ -233,46 +251,50 @@ fun foo() { ) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, - ) - - useCallable( - foo() { + object : Callable { + override fun call() { println("Hello world") - }, + } + }, ) useCallable( - { - println("Hello world") - }, + foo() { + println("Hello world") + }, ) useCallable( - Callable { println("Hello world") }, + { + println("Hello world") + }, ) - testtest(foofoo, testtest(testtest( - foofoo, - )), testsa) + useCallable( + Callable { println("Hello world") }, + ) testtest( - foofoo, fososos, testtest(testtest(foofoo)), + foofoo, testtest( + testtest( + foofoo, + ) + ), testsa + ) + + testtest( + foofoo, fososos, testtest(testtest(foofoo)), ) } fun test() { baz( - f = fun(it: Int): String = "$it", - /*dwdwd + f = fun(it: Int): String = "$it", + /*dwdwd + */ + name = "", + /* */ - name = "", - /* - */ ) } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListDoNotWrap.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListDoNotWrap.after.inv.kt index 42317dbbfc2c..8e826cb9d1af 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListDoNotWrap.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListDoNotWrap.after.inv.kt @@ -2,28 +2,34 @@ // SET_TRUE: ALLOW_TRAILING_COMMA fun foo() { - testtest(foofoo, foofoo, foofoo, - foofoo, bar) - testtest( - foofoo, foofoo, foofoo, foofoo, bar - ) - - testtest(foofoo, foofoo, foofoo, foofoo, bar - ) - - testtest(foofoo, foofoo, foofoo, foofoo, - bar - ) - - testtest(foofoo + foofoo, foofoo, foofoo, + foofoo, bar ) testtest( - foofoo) + foofoo, foofoo, foofoo, foofoo, bar + ) testtest( - foofoo + foofoo, foofoo, foofoo, foofoo, bar + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, + bar + ) + + testtest( + foofoo + ) + + testtest( + foofoo + ) + + testtest( + foofoo ) testtest(foofoo) @@ -56,7 +62,7 @@ fun foo() { } useCallable( - Callable { println("Hello world") }) + Callable { println("Hello world") }) useCallable("A", { println("Hello world") }) @@ -78,7 +84,7 @@ fun foo() { } useCallable( - { println("Hello world") }) + { println("Hello world") }) useCallable("A", foo() { println("Hello world") }) @@ -100,7 +106,7 @@ fun foo() { } useCallable( - foo() { println("Hello world") }) + foo() { println("Hello world") }) useCallable("A", object : Callable { override fun call() { @@ -129,11 +135,11 @@ fun foo() { }) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, + object : Callable { + override fun call() { + println("Hello world") + } + }, ) useCallable(object : Callable { @@ -152,15 +158,15 @@ fun foo() { } useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }) + object : Callable { + override fun call() { + println("Hello world") + } + }) testtest( - foofoo, foofoo, foofoo, foofoo, - bar /* + foofoo, foofoo, foofoo, foofoo, + bar /* */, /* */ foo ) @@ -168,60 +174,72 @@ fun foo() { */foofoo, foofoo, foofoo, /* */ - foofoo, bar) - - testtest(foofoo, foofoo, foofoo, foofoo, bar/* - */) - - testtest(foofoo, foofoo, foofoo, foofoo, bar // awdawda + foofoo, bar ) - testtest(foofoo, foofoo, foofoo, foofoo, /* + testtest( + foofoo, foofoo, foofoo, foofoo, bar/* + */ + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, bar // awdawda + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, /* */ - bar + bar ) - testtest(foofoo // fd + testtest( + foofoo // fd ) testtest( /**/ - foofoo - ) - - testtest(foofoo/**/) - - testtest(foofoo, foofoo, foofoo, foofoo/* - */, /* */ bar - ) - - testtest(foofoo // fd - ) - - testtest( /**/ - foofoo + foofoo ) testtest(foofoo/**/) testtest( - foofoo, fososos, - /* - */ - testtest(testtest(foofoo)), + foofoo, foofoo, foofoo, foofoo/* + */, /* */ bar + ) + + testtest( + foofoo // fd + ) + + testtest( /**/ + foofoo + ) + + testtest(foofoo/**/) + + testtest( + foofoo, fososos, + /* + */ + testtest(testtest(foofoo)), ) testtest(foofoo, testtest(testtest(foofoo)), /**/testsa) testtest(foofoo, testtest(testtest(foofoo))/* */, /**/testsa) - testtest(foofoo, testtest(testtest(foofoo))/* - */, testsa) + testtest( + foofoo, testtest(testtest(foofoo))/* + */, testsa + ) testtest(foofoo, seee, testtest(testtest(foofoo)), /**/testsa) - testtest(foofoo, seee, testtest(testtest(foofoo)), /* - */testsa) + testtest( + foofoo, seee, testtest(testtest(foofoo)), /* + */testsa + ) useCallable("B", "C", Callable { println("Hello world") @@ -233,46 +251,50 @@ fun foo() { ) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, - ) - - useCallable( - foo() { + object : Callable { + override fun call() { println("Hello world") - }, + } + }, ) useCallable( - { - println("Hello world") - }, + foo() { + println("Hello world") + }, ) useCallable( - Callable { println("Hello world") }, + { + println("Hello world") + }, ) - testtest(foofoo, testtest(testtest( - foofoo, - )), testsa) + useCallable( + Callable { println("Hello world") }, + ) testtest( - foofoo, fososos, testtest(testtest(foofoo)), + foofoo, testtest( + testtest( + foofoo, + ) + ), testsa + ) + + testtest( + foofoo, fososos, testtest(testtest(foofoo)), ) } fun test() { baz( - f = fun(it: Int): String = "$it", - /*dwdwd + f = fun(it: Int): String = "$it", + /*dwdwd + */ + name = "", + /* */ - name = "", - /* - */ ) } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListDoNotWrap.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListDoNotWrap.after.kt index 42317dbbfc2c..8e826cb9d1af 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListDoNotWrap.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListDoNotWrap.after.kt @@ -2,28 +2,34 @@ // SET_TRUE: ALLOW_TRAILING_COMMA fun foo() { - testtest(foofoo, foofoo, foofoo, - foofoo, bar) - testtest( - foofoo, foofoo, foofoo, foofoo, bar - ) - - testtest(foofoo, foofoo, foofoo, foofoo, bar - ) - - testtest(foofoo, foofoo, foofoo, foofoo, - bar - ) - - testtest(foofoo + foofoo, foofoo, foofoo, + foofoo, bar ) testtest( - foofoo) + foofoo, foofoo, foofoo, foofoo, bar + ) testtest( - foofoo + foofoo, foofoo, foofoo, foofoo, bar + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, + bar + ) + + testtest( + foofoo + ) + + testtest( + foofoo + ) + + testtest( + foofoo ) testtest(foofoo) @@ -56,7 +62,7 @@ fun foo() { } useCallable( - Callable { println("Hello world") }) + Callable { println("Hello world") }) useCallable("A", { println("Hello world") }) @@ -78,7 +84,7 @@ fun foo() { } useCallable( - { println("Hello world") }) + { println("Hello world") }) useCallable("A", foo() { println("Hello world") }) @@ -100,7 +106,7 @@ fun foo() { } useCallable( - foo() { println("Hello world") }) + foo() { println("Hello world") }) useCallable("A", object : Callable { override fun call() { @@ -129,11 +135,11 @@ fun foo() { }) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, + object : Callable { + override fun call() { + println("Hello world") + } + }, ) useCallable(object : Callable { @@ -152,15 +158,15 @@ fun foo() { } useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }) + object : Callable { + override fun call() { + println("Hello world") + } + }) testtest( - foofoo, foofoo, foofoo, foofoo, - bar /* + foofoo, foofoo, foofoo, foofoo, + bar /* */, /* */ foo ) @@ -168,60 +174,72 @@ fun foo() { */foofoo, foofoo, foofoo, /* */ - foofoo, bar) - - testtest(foofoo, foofoo, foofoo, foofoo, bar/* - */) - - testtest(foofoo, foofoo, foofoo, foofoo, bar // awdawda + foofoo, bar ) - testtest(foofoo, foofoo, foofoo, foofoo, /* + testtest( + foofoo, foofoo, foofoo, foofoo, bar/* + */ + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, bar // awdawda + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, /* */ - bar + bar ) - testtest(foofoo // fd + testtest( + foofoo // fd ) testtest( /**/ - foofoo - ) - - testtest(foofoo/**/) - - testtest(foofoo, foofoo, foofoo, foofoo/* - */, /* */ bar - ) - - testtest(foofoo // fd - ) - - testtest( /**/ - foofoo + foofoo ) testtest(foofoo/**/) testtest( - foofoo, fososos, - /* - */ - testtest(testtest(foofoo)), + foofoo, foofoo, foofoo, foofoo/* + */, /* */ bar + ) + + testtest( + foofoo // fd + ) + + testtest( /**/ + foofoo + ) + + testtest(foofoo/**/) + + testtest( + foofoo, fososos, + /* + */ + testtest(testtest(foofoo)), ) testtest(foofoo, testtest(testtest(foofoo)), /**/testsa) testtest(foofoo, testtest(testtest(foofoo))/* */, /**/testsa) - testtest(foofoo, testtest(testtest(foofoo))/* - */, testsa) + testtest( + foofoo, testtest(testtest(foofoo))/* + */, testsa + ) testtest(foofoo, seee, testtest(testtest(foofoo)), /**/testsa) - testtest(foofoo, seee, testtest(testtest(foofoo)), /* - */testsa) + testtest( + foofoo, seee, testtest(testtest(foofoo)), /* + */testsa + ) useCallable("B", "C", Callable { println("Hello world") @@ -233,46 +251,50 @@ fun foo() { ) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, - ) - - useCallable( - foo() { + object : Callable { + override fun call() { println("Hello world") - }, + } + }, ) useCallable( - { - println("Hello world") - }, + foo() { + println("Hello world") + }, ) useCallable( - Callable { println("Hello world") }, + { + println("Hello world") + }, ) - testtest(foofoo, testtest(testtest( - foofoo, - )), testsa) + useCallable( + Callable { println("Hello world") }, + ) testtest( - foofoo, fososos, testtest(testtest(foofoo)), + foofoo, testtest( + testtest( + foofoo, + ) + ), testsa + ) + + testtest( + foofoo, fososos, testtest(testtest(foofoo)), ) } fun test() { baz( - f = fun(it: Int): String = "$it", - /*dwdwd + f = fun(it: Int): String = "$it", + /*dwdwd + */ + name = "", + /* */ - name = "", - /* - */ ) } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAlways.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAlways.after.inv.kt index d33ac15e52dd..551668d440b5 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAlways.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAlways.after.inv.kt @@ -3,84 +3,98 @@ fun foo() { testtest( - foofoo, + foofoo, + testtest( testtest( - testtest( - foofoo, - ), + foofoo, ), - testsa, - ) - - testtest(foofoo, - foofoo, - foofoo, - foofoo, - bar) - - testtest( - foofoo, - foofoo, - foofoo, - foofoo, - bar - ) - - testtest(foofoo, - foofoo, - foofoo, - foofoo, - bar - ) - - testtest(foofoo, - foofoo, - foofoo, - foofoo, - bar - ) - - testtest(foofoo + ), + testsa, ) testtest( - foofoo) + foofoo, + foofoo, + foofoo, + foofoo, + bar + ) testtest( - foofoo + foofoo, + foofoo, + foofoo, + foofoo, + bar + ) + + testtest( + foofoo, + foofoo, + foofoo, + foofoo, + bar + ) + + testtest( + foofoo, + foofoo, + foofoo, + foofoo, + bar + ) + + testtest( + foofoo + ) + + testtest( + foofoo + ) + + testtest( + foofoo ) testtest(foofoo) - testtest(foofoo, - testtest(testtest(foofoo))) - testtest( - foofoo, - fososos, - testtest(testtest(foofoo)), + foofoo, + testtest(testtest(foofoo)) ) - testtest(foofoo, - testtest(testtest(foofoo)), - testsa) + testtest( + foofoo, + fososos, + testtest(testtest(foofoo)), + ) - testtest(foofoo, - seee, - testtest(testtest(foofoo)), - testsa) + testtest( + foofoo, + testtest(testtest(foofoo)), + testsa + ) - useCallable("A", - Callable { println("Hello world") }) + testtest( + foofoo, + seee, + testtest(testtest(foofoo)), + testsa + ) - useCallable("B", - "C", - Callable { - println("Hello world") - }, - Callable { - println("Hello world") - }) + useCallable( + "A", + Callable { println("Hello world") }) + + useCallable( + "B", + "C", + Callable { + println("Hello world") + }, + Callable { + println("Hello world") + }) useCallable(Callable { println("Hello world") }) @@ -94,19 +108,21 @@ fun foo() { } useCallable( - Callable { println("Hello world") }) + Callable { println("Hello world") }) - useCallable("A", - { println("Hello world") }) + useCallable( + "A", + { println("Hello world") }) - useCallable("B", - "C", - { - println("Hello world") - }, - { - println("Hello world") - }) + useCallable( + "B", + "C", + { + println("Hello world") + }, + { + println("Hello world") + }) useCallable({ println("Hello world") }) @@ -120,19 +136,21 @@ fun foo() { } useCallable( - { println("Hello world") }) + { println("Hello world") }) - useCallable("A", - foo() { println("Hello world") }) + useCallable( + "A", + foo() { println("Hello world") }) - useCallable("B", - "C", - foo() { - println("Hello world") - }, - foo() { - println("Hello world") - }) + useCallable( + "B", + "C", + foo() { + println("Hello world") + }, + foo() { + println("Hello world") + }) useCallable(foo() { println("Hello world") }) @@ -146,32 +164,35 @@ fun foo() { } useCallable( - foo() { println("Hello world") }) + foo() { println("Hello world") }) - useCallable("A", - object : Callable { - override fun call() { - println("Hello world") - } - }) - - useCallable("A", - object : Callable { - override fun call() { - println("Hello world") - } - }) - - useCallable("B", - "C", - object : Callable { - override fun call() { - println("Hello world") - } - }, - foo() { + useCallable( + "A", + object : Callable { + override fun call() { println("Hello world") - }) + } + }) + + useCallable( + "A", + object : Callable { + override fun call() { + println("Hello world") + } + }) + + useCallable( + "B", + "C", + object : Callable { + override fun call() { + println("Hello world") + } + }, + foo() { + println("Hello world") + }) useCallable(object : Callable { override fun call() { @@ -180,11 +201,11 @@ fun foo() { }) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, + object : Callable { + override fun call() { + println("Hello world") + } + }, ) useCallable(object : Callable { @@ -203,169 +224,192 @@ fun foo() { } useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }) + object : Callable { + override fun call() { + println("Hello world") + } + }) testtest( - foofoo, - foofoo, - foofoo, - foofoo, - bar /* + foofoo, + foofoo, + foofoo, + foofoo, + bar /* */, /* */ - foo + foo ) testtest(/* */foofoo, - foofoo, - foofoo, /* + foofoo, + foofoo, /* */ - foofoo, - bar) - - testtest(foofoo, - foofoo, - foofoo, - foofoo, - bar/* - */) - - testtest(foofoo, - foofoo, - foofoo, - foofoo, - bar // awdawda + foofoo, + bar ) - testtest(foofoo, - foofoo, - foofoo, - foofoo, /* + testtest( + foofoo, + foofoo, + foofoo, + foofoo, + bar/* + */ + ) + + testtest( + foofoo, + foofoo, + foofoo, + foofoo, + bar // awdawda + ) + + testtest( + foofoo, + foofoo, + foofoo, + foofoo, /* */ - bar + bar ) - testtest(foofoo // fd + testtest( + foofoo // fd ) testtest( /**/ - foofoo - ) - - testtest(foofoo/**/) - - testtest(foofoo, - foofoo, - foofoo, - foofoo/* - */, /* */ - bar - ) - - testtest(foofoo // fd - ) - - testtest( /**/ - foofoo + foofoo ) testtest(foofoo/**/) testtest( - foofoo, - fososos, - /* - */ - testtest(testtest(foofoo)), + foofoo, + foofoo, + foofoo, + foofoo/* + */, /* */ + bar ) - testtest(foofoo, - testtest(testtest(foofoo)), /**/ - testsa) + testtest( + foofoo // fd + ) - testtest(foofoo, - testtest(testtest(foofoo))/* */, /**/ - testsa) + testtest( /**/ + foofoo + ) - testtest(foofoo, - testtest(testtest(foofoo))/* - */, - testsa) + testtest(foofoo/**/) - testtest(foofoo, - seee, - testtest(testtest(foofoo)), /**/ - testsa) - - testtest(foofoo, - seee, - testtest(testtest(foofoo)), /* + testtest( + foofoo, + fososos, + /* */ - testsa) + testtest(testtest(foofoo)), + ) - useCallable("B", - "C", - Callable { - println("Hello world") - }, /* */ - Callable { - println("Hello world") - }) + testtest( + foofoo, + testtest(testtest(foofoo)), /**/ + testsa + ) + + testtest( + foofoo, + testtest(testtest(foofoo))/* */, /**/ + testsa + ) + + testtest( + foofoo, + testtest(testtest(foofoo))/* + */, + testsa + ) + + testtest( + foofoo, + seee, + testtest(testtest(foofoo)), /**/ + testsa + ) + + testtest( + foofoo, + seee, + testtest(testtest(foofoo)), /* + */ + testsa + ) + + useCallable( + "B", + "C", + Callable { + println("Hello world") + }, /* */ + Callable { + println("Hello world") + }) useCallable(Callable { println("Hello world") } // ffd ) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, - ) - - useCallable( - foo() { + object : Callable { + override fun call() { println("Hello world") - }, + } + }, ) useCallable( - { - println("Hello world") - }, + foo() { + println("Hello world") + }, ) useCallable( - Callable { println("Hello world") }, + { + println("Hello world") + }, ) - testtest(foofoo, - testtest(testtest( - foofoo, - )), - testsa) + useCallable( + Callable { println("Hello world") }, + ) testtest( - foofoo, - fososos, - testtest(testtest(foofoo)), + foofoo, + testtest( + testtest( + foofoo, + ) + ), + testsa + ) + + testtest( + foofoo, + fososos, + testtest(testtest(foofoo)), ) } fun test() { baz( - f = fun(it: Int): String = "$it", - /*dwdwd + f = fun(it: Int): String = "$it", + /*dwdwd + */ + name = "", + /* */ - name = "", - /* - */ ) } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAlways.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAlways.after.kt index d33ac15e52dd..551668d440b5 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAlways.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAlways.after.kt @@ -3,84 +3,98 @@ fun foo() { testtest( - foofoo, + foofoo, + testtest( testtest( - testtest( - foofoo, - ), + foofoo, ), - testsa, - ) - - testtest(foofoo, - foofoo, - foofoo, - foofoo, - bar) - - testtest( - foofoo, - foofoo, - foofoo, - foofoo, - bar - ) - - testtest(foofoo, - foofoo, - foofoo, - foofoo, - bar - ) - - testtest(foofoo, - foofoo, - foofoo, - foofoo, - bar - ) - - testtest(foofoo + ), + testsa, ) testtest( - foofoo) + foofoo, + foofoo, + foofoo, + foofoo, + bar + ) testtest( - foofoo + foofoo, + foofoo, + foofoo, + foofoo, + bar + ) + + testtest( + foofoo, + foofoo, + foofoo, + foofoo, + bar + ) + + testtest( + foofoo, + foofoo, + foofoo, + foofoo, + bar + ) + + testtest( + foofoo + ) + + testtest( + foofoo + ) + + testtest( + foofoo ) testtest(foofoo) - testtest(foofoo, - testtest(testtest(foofoo))) - testtest( - foofoo, - fososos, - testtest(testtest(foofoo)), + foofoo, + testtest(testtest(foofoo)) ) - testtest(foofoo, - testtest(testtest(foofoo)), - testsa) + testtest( + foofoo, + fososos, + testtest(testtest(foofoo)), + ) - testtest(foofoo, - seee, - testtest(testtest(foofoo)), - testsa) + testtest( + foofoo, + testtest(testtest(foofoo)), + testsa + ) - useCallable("A", - Callable { println("Hello world") }) + testtest( + foofoo, + seee, + testtest(testtest(foofoo)), + testsa + ) - useCallable("B", - "C", - Callable { - println("Hello world") - }, - Callable { - println("Hello world") - }) + useCallable( + "A", + Callable { println("Hello world") }) + + useCallable( + "B", + "C", + Callable { + println("Hello world") + }, + Callable { + println("Hello world") + }) useCallable(Callable { println("Hello world") }) @@ -94,19 +108,21 @@ fun foo() { } useCallable( - Callable { println("Hello world") }) + Callable { println("Hello world") }) - useCallable("A", - { println("Hello world") }) + useCallable( + "A", + { println("Hello world") }) - useCallable("B", - "C", - { - println("Hello world") - }, - { - println("Hello world") - }) + useCallable( + "B", + "C", + { + println("Hello world") + }, + { + println("Hello world") + }) useCallable({ println("Hello world") }) @@ -120,19 +136,21 @@ fun foo() { } useCallable( - { println("Hello world") }) + { println("Hello world") }) - useCallable("A", - foo() { println("Hello world") }) + useCallable( + "A", + foo() { println("Hello world") }) - useCallable("B", - "C", - foo() { - println("Hello world") - }, - foo() { - println("Hello world") - }) + useCallable( + "B", + "C", + foo() { + println("Hello world") + }, + foo() { + println("Hello world") + }) useCallable(foo() { println("Hello world") }) @@ -146,32 +164,35 @@ fun foo() { } useCallable( - foo() { println("Hello world") }) + foo() { println("Hello world") }) - useCallable("A", - object : Callable { - override fun call() { - println("Hello world") - } - }) - - useCallable("A", - object : Callable { - override fun call() { - println("Hello world") - } - }) - - useCallable("B", - "C", - object : Callable { - override fun call() { - println("Hello world") - } - }, - foo() { + useCallable( + "A", + object : Callable { + override fun call() { println("Hello world") - }) + } + }) + + useCallable( + "A", + object : Callable { + override fun call() { + println("Hello world") + } + }) + + useCallable( + "B", + "C", + object : Callable { + override fun call() { + println("Hello world") + } + }, + foo() { + println("Hello world") + }) useCallable(object : Callable { override fun call() { @@ -180,11 +201,11 @@ fun foo() { }) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, + object : Callable { + override fun call() { + println("Hello world") + } + }, ) useCallable(object : Callable { @@ -203,169 +224,192 @@ fun foo() { } useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }) + object : Callable { + override fun call() { + println("Hello world") + } + }) testtest( - foofoo, - foofoo, - foofoo, - foofoo, - bar /* + foofoo, + foofoo, + foofoo, + foofoo, + bar /* */, /* */ - foo + foo ) testtest(/* */foofoo, - foofoo, - foofoo, /* + foofoo, + foofoo, /* */ - foofoo, - bar) - - testtest(foofoo, - foofoo, - foofoo, - foofoo, - bar/* - */) - - testtest(foofoo, - foofoo, - foofoo, - foofoo, - bar // awdawda + foofoo, + bar ) - testtest(foofoo, - foofoo, - foofoo, - foofoo, /* + testtest( + foofoo, + foofoo, + foofoo, + foofoo, + bar/* + */ + ) + + testtest( + foofoo, + foofoo, + foofoo, + foofoo, + bar // awdawda + ) + + testtest( + foofoo, + foofoo, + foofoo, + foofoo, /* */ - bar + bar ) - testtest(foofoo // fd + testtest( + foofoo // fd ) testtest( /**/ - foofoo - ) - - testtest(foofoo/**/) - - testtest(foofoo, - foofoo, - foofoo, - foofoo/* - */, /* */ - bar - ) - - testtest(foofoo // fd - ) - - testtest( /**/ - foofoo + foofoo ) testtest(foofoo/**/) testtest( - foofoo, - fososos, - /* - */ - testtest(testtest(foofoo)), + foofoo, + foofoo, + foofoo, + foofoo/* + */, /* */ + bar ) - testtest(foofoo, - testtest(testtest(foofoo)), /**/ - testsa) + testtest( + foofoo // fd + ) - testtest(foofoo, - testtest(testtest(foofoo))/* */, /**/ - testsa) + testtest( /**/ + foofoo + ) - testtest(foofoo, - testtest(testtest(foofoo))/* - */, - testsa) + testtest(foofoo/**/) - testtest(foofoo, - seee, - testtest(testtest(foofoo)), /**/ - testsa) - - testtest(foofoo, - seee, - testtest(testtest(foofoo)), /* + testtest( + foofoo, + fososos, + /* */ - testsa) + testtest(testtest(foofoo)), + ) - useCallable("B", - "C", - Callable { - println("Hello world") - }, /* */ - Callable { - println("Hello world") - }) + testtest( + foofoo, + testtest(testtest(foofoo)), /**/ + testsa + ) + + testtest( + foofoo, + testtest(testtest(foofoo))/* */, /**/ + testsa + ) + + testtest( + foofoo, + testtest(testtest(foofoo))/* + */, + testsa + ) + + testtest( + foofoo, + seee, + testtest(testtest(foofoo)), /**/ + testsa + ) + + testtest( + foofoo, + seee, + testtest(testtest(foofoo)), /* + */ + testsa + ) + + useCallable( + "B", + "C", + Callable { + println("Hello world") + }, /* */ + Callable { + println("Hello world") + }) useCallable(Callable { println("Hello world") } // ffd ) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, - ) - - useCallable( - foo() { + object : Callable { + override fun call() { println("Hello world") - }, + } + }, ) useCallable( - { - println("Hello world") - }, + foo() { + println("Hello world") + }, ) useCallable( - Callable { println("Hello world") }, + { + println("Hello world") + }, ) - testtest(foofoo, - testtest(testtest( - foofoo, - )), - testsa) + useCallable( + Callable { println("Hello world") }, + ) testtest( - foofoo, - fososos, - testtest(testtest(foofoo)), + foofoo, + testtest( + testtest( + foofoo, + ) + ), + testsa + ) + + testtest( + foofoo, + fososos, + testtest(testtest(foofoo)), ) } fun test() { baz( - f = fun(it: Int): String = "$it", - /*dwdwd + f = fun(it: Int): String = "$it", + /*dwdwd + */ + name = "", + /* */ - name = "", - /* - */ ) } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAsNeeded.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAsNeeded.after.inv.kt index 17289c36554f..8508c426aa89 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAsNeeded.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAsNeeded.after.inv.kt @@ -2,28 +2,34 @@ // SET_TRUE: ALLOW_TRAILING_COMMA fun foo() { - testtest(foofoo, foofoo, foofoo, - foofoo, bar) - testtest( - foofoo, foofoo, foofoo, foofoo, bar - ) - - testtest(foofoo, foofoo, foofoo, foofoo, bar - ) - - testtest(foofoo, foofoo, foofoo, foofoo, - bar - ) - - testtest(foofoo + foofoo, foofoo, foofoo, + foofoo, bar ) testtest( - foofoo) + foofoo, foofoo, foofoo, foofoo, bar + ) testtest( - foofoo + foofoo, foofoo, foofoo, foofoo, bar + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, + bar + ) + + testtest( + foofoo + ) + + testtest( + foofoo + ) + + testtest( + foofoo ) testtest(foofoo) @@ -56,7 +62,7 @@ fun foo() { } useCallable( - Callable { println("Hello world") }) + Callable { println("Hello world") }) useCallable("A", { println("Hello world") }) @@ -78,7 +84,7 @@ fun foo() { } useCallable( - { println("Hello world") }) + { println("Hello world") }) useCallable("A", foo() { println("Hello world") }) @@ -100,7 +106,7 @@ fun foo() { } useCallable( - foo() { println("Hello world") }) + foo() { println("Hello world") }) useCallable("A", object : Callable { override fun call() { @@ -129,11 +135,11 @@ fun foo() { }) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, + object : Callable { + override fun call() { + println("Hello world") + } + }, ) useCallable(object : Callable { @@ -152,15 +158,15 @@ fun foo() { } useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }) + object : Callable { + override fun call() { + println("Hello world") + } + }) testtest( - foofoo, foofoo, foofoo, foofoo, - bar /* + foofoo, foofoo, foofoo, foofoo, + bar /* */, /* */ foo ) @@ -168,60 +174,72 @@ fun foo() { */foofoo, foofoo, foofoo, /* */ - foofoo, bar) - - testtest(foofoo, foofoo, foofoo, foofoo, bar/* - */) - - testtest(foofoo, foofoo, foofoo, foofoo, bar // awdawda + foofoo, bar ) - testtest(foofoo, foofoo, foofoo, foofoo, /* + testtest( + foofoo, foofoo, foofoo, foofoo, bar/* + */ + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, bar // awdawda + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, /* */ - bar + bar ) - testtest(foofoo // fd + testtest( + foofoo // fd ) testtest( /**/ - foofoo - ) - - testtest(foofoo/**/) - - testtest(foofoo, foofoo, foofoo, foofoo/* - */, /* */ bar - ) - - testtest(foofoo // fd - ) - - testtest( /**/ - foofoo + foofoo ) testtest(foofoo/**/) testtest( - foofoo, fososos, - /* - */ - testtest(testtest(foofoo)), + foofoo, foofoo, foofoo, foofoo/* + */, /* */ bar + ) + + testtest( + foofoo // fd + ) + + testtest( /**/ + foofoo + ) + + testtest(foofoo/**/) + + testtest( + foofoo, fososos, + /* + */ + testtest(testtest(foofoo)), ) testtest(foofoo, testtest(testtest(foofoo)), /**/testsa) testtest(foofoo, testtest(testtest(foofoo))/* */, /**/testsa) - testtest(foofoo, testtest(testtest(foofoo))/* - */, testsa) + testtest( + foofoo, testtest(testtest(foofoo))/* + */, testsa + ) testtest(foofoo, seee, testtest(testtest(foofoo)), /**/testsa) - testtest(foofoo, seee, testtest(testtest(foofoo)), /* - */testsa) + testtest( + foofoo, seee, testtest(testtest(foofoo)), /* + */testsa + ) useCallable("B", "C", Callable { println("Hello world") @@ -233,46 +251,50 @@ fun foo() { ) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, - ) - - useCallable( - foo() { + object : Callable { + override fun call() { println("Hello world") - }, + } + }, ) useCallable( - { - println("Hello world") - }, + foo() { + println("Hello world") + }, ) useCallable( - Callable { println("Hello world") }, + { + println("Hello world") + }, ) - testtest(foofoo, testtest(testtest( - foofoo, - )), testsa) + useCallable( + Callable { println("Hello world") }, + ) testtest( - foofoo, fososos, testtest(testtest(foofoo)), + foofoo, testtest( + testtest( + foofoo, + ) + ), testsa + ) + + testtest( + foofoo, fososos, testtest(testtest(foofoo)), ) } fun test() { baz( - f = fun(it: Int): String = "$it", - /*dwdwd + f = fun(it: Int): String = "$it", + /*dwdwd + */ + name = "", + /* */ - name = "", - /* - */ ) } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAsNeeded.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAsNeeded.after.kt index 17289c36554f..8508c426aa89 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAsNeeded.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAsNeeded.after.kt @@ -2,28 +2,34 @@ // SET_TRUE: ALLOW_TRAILING_COMMA fun foo() { - testtest(foofoo, foofoo, foofoo, - foofoo, bar) - testtest( - foofoo, foofoo, foofoo, foofoo, bar - ) - - testtest(foofoo, foofoo, foofoo, foofoo, bar - ) - - testtest(foofoo, foofoo, foofoo, foofoo, - bar - ) - - testtest(foofoo + foofoo, foofoo, foofoo, + foofoo, bar ) testtest( - foofoo) + foofoo, foofoo, foofoo, foofoo, bar + ) testtest( - foofoo + foofoo, foofoo, foofoo, foofoo, bar + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, + bar + ) + + testtest( + foofoo + ) + + testtest( + foofoo + ) + + testtest( + foofoo ) testtest(foofoo) @@ -56,7 +62,7 @@ fun foo() { } useCallable( - Callable { println("Hello world") }) + Callable { println("Hello world") }) useCallable("A", { println("Hello world") }) @@ -78,7 +84,7 @@ fun foo() { } useCallable( - { println("Hello world") }) + { println("Hello world") }) useCallable("A", foo() { println("Hello world") }) @@ -100,7 +106,7 @@ fun foo() { } useCallable( - foo() { println("Hello world") }) + foo() { println("Hello world") }) useCallable("A", object : Callable { override fun call() { @@ -129,11 +135,11 @@ fun foo() { }) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, + object : Callable { + override fun call() { + println("Hello world") + } + }, ) useCallable(object : Callable { @@ -152,15 +158,15 @@ fun foo() { } useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }) + object : Callable { + override fun call() { + println("Hello world") + } + }) testtest( - foofoo, foofoo, foofoo, foofoo, - bar /* + foofoo, foofoo, foofoo, foofoo, + bar /* */, /* */ foo ) @@ -168,60 +174,72 @@ fun foo() { */foofoo, foofoo, foofoo, /* */ - foofoo, bar) - - testtest(foofoo, foofoo, foofoo, foofoo, bar/* - */) - - testtest(foofoo, foofoo, foofoo, foofoo, bar // awdawda + foofoo, bar ) - testtest(foofoo, foofoo, foofoo, foofoo, /* + testtest( + foofoo, foofoo, foofoo, foofoo, bar/* + */ + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, bar // awdawda + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, /* */ - bar + bar ) - testtest(foofoo // fd + testtest( + foofoo // fd ) testtest( /**/ - foofoo - ) - - testtest(foofoo/**/) - - testtest(foofoo, foofoo, foofoo, foofoo/* - */, /* */ bar - ) - - testtest(foofoo // fd - ) - - testtest( /**/ - foofoo + foofoo ) testtest(foofoo/**/) testtest( - foofoo, fososos, - /* - */ - testtest(testtest(foofoo)), + foofoo, foofoo, foofoo, foofoo/* + */, /* */ bar + ) + + testtest( + foofoo // fd + ) + + testtest( /**/ + foofoo + ) + + testtest(foofoo/**/) + + testtest( + foofoo, fososos, + /* + */ + testtest(testtest(foofoo)), ) testtest(foofoo, testtest(testtest(foofoo)), /**/testsa) testtest(foofoo, testtest(testtest(foofoo))/* */, /**/testsa) - testtest(foofoo, testtest(testtest(foofoo))/* - */, testsa) + testtest( + foofoo, testtest(testtest(foofoo))/* + */, testsa + ) testtest(foofoo, seee, testtest(testtest(foofoo)), /**/testsa) - testtest(foofoo, seee, testtest(testtest(foofoo)), /* - */testsa) + testtest( + foofoo, seee, testtest(testtest(foofoo)), /* + */testsa + ) useCallable("B", "C", Callable { println("Hello world") @@ -233,46 +251,50 @@ fun foo() { ) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, - ) - - useCallable( - foo() { + object : Callable { + override fun call() { println("Hello world") - }, + } + }, ) useCallable( - { - println("Hello world") - }, + foo() { + println("Hello world") + }, ) useCallable( - Callable { println("Hello world") }, + { + println("Hello world") + }, ) - testtest(foofoo, testtest(testtest( - foofoo, - )), testsa) + useCallable( + Callable { println("Hello world") }, + ) testtest( - foofoo, fososos, testtest(testtest(foofoo)), + foofoo, testtest( + testtest( + foofoo, + ) + ), testsa + ) + + testtest( + foofoo, fososos, testtest(testtest(foofoo)), ) } fun test() { baz( - f = fun(it: Int): String = "$it", - /*dwdwd + f = fun(it: Int): String = "$it", + /*dwdwd + */ + name = "", + /* */ - name = "", - /* - */ ) } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAsNeeded.call.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAsNeeded.call.after.inv.kt index 17289c36554f..8508c426aa89 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAsNeeded.call.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAsNeeded.call.after.inv.kt @@ -2,28 +2,34 @@ // SET_TRUE: ALLOW_TRAILING_COMMA fun foo() { - testtest(foofoo, foofoo, foofoo, - foofoo, bar) - testtest( - foofoo, foofoo, foofoo, foofoo, bar - ) - - testtest(foofoo, foofoo, foofoo, foofoo, bar - ) - - testtest(foofoo, foofoo, foofoo, foofoo, - bar - ) - - testtest(foofoo + foofoo, foofoo, foofoo, + foofoo, bar ) testtest( - foofoo) + foofoo, foofoo, foofoo, foofoo, bar + ) testtest( - foofoo + foofoo, foofoo, foofoo, foofoo, bar + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, + bar + ) + + testtest( + foofoo + ) + + testtest( + foofoo + ) + + testtest( + foofoo ) testtest(foofoo) @@ -56,7 +62,7 @@ fun foo() { } useCallable( - Callable { println("Hello world") }) + Callable { println("Hello world") }) useCallable("A", { println("Hello world") }) @@ -78,7 +84,7 @@ fun foo() { } useCallable( - { println("Hello world") }) + { println("Hello world") }) useCallable("A", foo() { println("Hello world") }) @@ -100,7 +106,7 @@ fun foo() { } useCallable( - foo() { println("Hello world") }) + foo() { println("Hello world") }) useCallable("A", object : Callable { override fun call() { @@ -129,11 +135,11 @@ fun foo() { }) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, + object : Callable { + override fun call() { + println("Hello world") + } + }, ) useCallable(object : Callable { @@ -152,15 +158,15 @@ fun foo() { } useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }) + object : Callable { + override fun call() { + println("Hello world") + } + }) testtest( - foofoo, foofoo, foofoo, foofoo, - bar /* + foofoo, foofoo, foofoo, foofoo, + bar /* */, /* */ foo ) @@ -168,60 +174,72 @@ fun foo() { */foofoo, foofoo, foofoo, /* */ - foofoo, bar) - - testtest(foofoo, foofoo, foofoo, foofoo, bar/* - */) - - testtest(foofoo, foofoo, foofoo, foofoo, bar // awdawda + foofoo, bar ) - testtest(foofoo, foofoo, foofoo, foofoo, /* + testtest( + foofoo, foofoo, foofoo, foofoo, bar/* + */ + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, bar // awdawda + ) + + testtest( + foofoo, foofoo, foofoo, foofoo, /* */ - bar + bar ) - testtest(foofoo // fd + testtest( + foofoo // fd ) testtest( /**/ - foofoo - ) - - testtest(foofoo/**/) - - testtest(foofoo, foofoo, foofoo, foofoo/* - */, /* */ bar - ) - - testtest(foofoo // fd - ) - - testtest( /**/ - foofoo + foofoo ) testtest(foofoo/**/) testtest( - foofoo, fososos, - /* - */ - testtest(testtest(foofoo)), + foofoo, foofoo, foofoo, foofoo/* + */, /* */ bar + ) + + testtest( + foofoo // fd + ) + + testtest( /**/ + foofoo + ) + + testtest(foofoo/**/) + + testtest( + foofoo, fososos, + /* + */ + testtest(testtest(foofoo)), ) testtest(foofoo, testtest(testtest(foofoo)), /**/testsa) testtest(foofoo, testtest(testtest(foofoo))/* */, /**/testsa) - testtest(foofoo, testtest(testtest(foofoo))/* - */, testsa) + testtest( + foofoo, testtest(testtest(foofoo))/* + */, testsa + ) testtest(foofoo, seee, testtest(testtest(foofoo)), /**/testsa) - testtest(foofoo, seee, testtest(testtest(foofoo)), /* - */testsa) + testtest( + foofoo, seee, testtest(testtest(foofoo)), /* + */testsa + ) useCallable("B", "C", Callable { println("Hello world") @@ -233,46 +251,50 @@ fun foo() { ) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, - ) - - useCallable( - foo() { + object : Callable { + override fun call() { println("Hello world") - }, + } + }, ) useCallable( - { - println("Hello world") - }, + foo() { + println("Hello world") + }, ) useCallable( - Callable { println("Hello world") }, + { + println("Hello world") + }, ) - testtest(foofoo, testtest(testtest( - foofoo, - )), testsa) + useCallable( + Callable { println("Hello world") }, + ) testtest( - foofoo, fososos, testtest(testtest(foofoo)), + foofoo, testtest( + testtest( + foofoo, + ) + ), testsa + ) + + testtest( + foofoo, fososos, testtest(testtest(foofoo)), ) } fun test() { baz( - f = fun(it: Int): String = "$it", - /*dwdwd + f = fun(it: Int): String = "$it", + /*dwdwd + */ + name = "", + /* */ - name = "", - /* - */ ) } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAsNeeded.call.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAsNeeded.call.after.kt index 5d0a2ce7820f..cb090b14d84f 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAsNeeded.call.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/ArgumentListWrapAsNeeded.call.after.kt @@ -3,33 +3,33 @@ fun foo() { testtest( - foofoo, foofoo, foofoo, - foofoo, bar, + foofoo, foofoo, foofoo, + foofoo, bar, ) testtest( - foofoo, foofoo, foofoo, foofoo, bar, + foofoo, foofoo, foofoo, foofoo, bar, ) testtest( - foofoo, foofoo, foofoo, foofoo, bar, + foofoo, foofoo, foofoo, foofoo, bar, ) testtest( - foofoo, foofoo, foofoo, foofoo, - bar, + foofoo, foofoo, foofoo, foofoo, + bar, ) testtest( - foofoo, + foofoo, ) testtest( - foofoo, + foofoo, ) testtest( - foofoo, + foofoo, ) testtest(foofoo) @@ -45,13 +45,13 @@ fun foo() { useCallable("A", Callable { println("Hello world") }) useCallable( - "B", "C", - Callable { - println("Hello world") - }, - Callable { - println("Hello world") - }, + "B", "C", + Callable { + println("Hello world") + }, + Callable { + println("Hello world") + }, ) useCallable(Callable { println("Hello world") }) @@ -59,7 +59,7 @@ fun foo() { useCallable(Callable { println("Hello world") }) useCallable( - Callable { println("Hello world") }, + Callable { println("Hello world") }, ) useCallable(Callable { println("Hello world") }) { @@ -67,19 +67,19 @@ fun foo() { } useCallable( - Callable { println("Hello world") }, + Callable { println("Hello world") }, ) useCallable("A", { println("Hello world") }) useCallable( - "B", "C", - { - println("Hello world") - }, - { - println("Hello world") - }, + "B", "C", + { + println("Hello world") + }, + { + println("Hello world") + }, ) useCallable({ println("Hello world") }) @@ -87,7 +87,7 @@ fun foo() { useCallable({ println("Hello world") }) useCallable( - { println("Hello world") }, + { println("Hello world") }, ) useCallable({ println("Hello world") }) { @@ -95,19 +95,19 @@ fun foo() { } useCallable( - { println("Hello world") }, + { println("Hello world") }, ) useCallable("A", foo() { println("Hello world") }) useCallable( - "B", "C", - foo() { - println("Hello world") - }, - foo() { - println("Hello world") - }, + "B", "C", + foo() { + println("Hello world") + }, + foo() { + println("Hello world") + }, ) useCallable(foo() { println("Hello world") }) @@ -115,7 +115,7 @@ fun foo() { useCallable(foo() { println("Hello world") }) useCallable( - foo() { println("Hello world") }, + foo() { println("Hello world") }, ) useCallable(foo() { println("Hello world") }) { @@ -123,151 +123,151 @@ fun foo() { } useCallable( - foo() { println("Hello world") }, + foo() { println("Hello world") }, ) useCallable( - "A", - object : Callable { - override fun call() { - println("Hello world") - } - }, - ) - - useCallable( - "A", - object : Callable { - override fun call() { - println("Hello world") - } - }, - ) - - useCallable( - "B", "C", - object : Callable { - override fun call() { - println("Hello world") - } - }, - foo() { + "A", + object : Callable { + override fun call() { println("Hello world") - }, + } + }, ) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, + "A", + object : Callable { + override fun call() { + println("Hello world") + } + }, ) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, + "B", "C", + object : Callable { + override fun call() { + println("Hello world") + } + }, + foo() { + println("Hello world") + }, ) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, + object : Callable { + override fun call() { + println("Hello world") + } + }, ) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, + object : Callable { + override fun call() { + println("Hello world") + } + }, + ) + + useCallable( + object : Callable { + override fun call() { + println("Hello world") + } + }, + ) + + useCallable( + object : Callable { + override fun call() { + println("Hello world") + } + }, ) { } useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, + object : Callable { + override fun call() { + println("Hello world") + } + }, ) testtest( - foofoo, foofoo, foofoo, foofoo, - bar, - /* - */ - /* */ foo, + foofoo, foofoo, foofoo, foofoo, + bar, + /* + */ + /* */ foo, ) testtest( - /* - */ - foofoo, foofoo, foofoo, - /* + /* + */ + foofoo, foofoo, foofoo, + /* - */ - foofoo, bar, + */ + foofoo, bar, ) testtest( - foofoo, foofoo, foofoo, foofoo, bar, - /* - */ + foofoo, foofoo, foofoo, foofoo, bar, + /* + */ ) testtest( - foofoo, foofoo, foofoo, foofoo, bar, // awdawda + foofoo, foofoo, foofoo, foofoo, bar, // awdawda ) testtest( - foofoo, foofoo, foofoo, foofoo, - /* + foofoo, foofoo, foofoo, foofoo, + /* - */ - bar, + */ + bar, ) testtest( - foofoo, // fd + foofoo, // fd ) testtest( - /**/ - foofoo, + /**/ + foofoo, ) testtest(foofoo/**/) testtest( - foofoo, foofoo, foofoo, foofoo, - /* - */ - /* */ bar, + foofoo, foofoo, foofoo, foofoo, + /* + */ + /* */ bar, ) testtest( - foofoo, // fd + foofoo, // fd ) testtest( - /**/ - foofoo, + /**/ + foofoo, ) testtest(foofoo/**/) testtest( - foofoo, fososos, - /* - */ - testtest(testtest(foofoo)), + foofoo, fososos, + /* + */ + testtest(testtest(foofoo)), ) testtest(foofoo, testtest(testtest(foofoo)), /**/testsa) @@ -275,83 +275,83 @@ fun foo() { testtest(foofoo, testtest(testtest(foofoo))/* */, /**/testsa) testtest( - foofoo, testtest(testtest(foofoo)), - /* - */ - testsa, + foofoo, testtest(testtest(foofoo)), + /* + */ + testsa, ) testtest(foofoo, seee, testtest(testtest(foofoo)), /**/testsa) testtest( - foofoo, seee, testtest(testtest(foofoo)), - /* - */ - testsa, + foofoo, seee, testtest(testtest(foofoo)), + /* + */ + testsa, ) useCallable( - "B", "C", - Callable { + "B", "C", + Callable { + println("Hello world") + }, + /* */ + Callable { + println("Hello world") + }, + ) + + useCallable( + Callable { println("Hello world") }, // ffd + ) + + useCallable( + object : Callable { + override fun call() { println("Hello world") - }, - /* */ - Callable { - println("Hello world") - }, + } + }, ) useCallable( - Callable { println("Hello world") }, // ffd + foo() { + println("Hello world") + }, ) useCallable( - object : Callable { - override fun call() { - println("Hello world") - } - }, + { + println("Hello world") + }, ) useCallable( - foo() { - println("Hello world") - }, - ) - - useCallable( - { - println("Hello world") - }, - ) - - useCallable( - Callable { println("Hello world") }, + Callable { println("Hello world") }, ) testtest( - foofoo, + foofoo, + testtest( testtest( - testtest( - foofoo, - ), + foofoo, ), - testsa, + ), + testsa, ) testtest( - foofoo, fososos, testtest(testtest(foofoo)), + foofoo, fososos, testtest(testtest(foofoo)), ) } fun test() { baz( - f = fun(it: Int): String = "$it", - /*dwdwd + f = fun(it: Int): String = "$it", + /*dwdwd + */ + name = "", + /* */ - name = "", - /* - */ ) } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/NamedArguments.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/NamedArguments.after.inv.kt index 59301054fd7c..134e48c3cedd 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/NamedArguments.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/NamedArguments.after.inv.kt @@ -1,49 +1,49 @@ fun check() { check( - /* a = */ 1, - /* a = */ 1, - /* b = */ "42" + /* a = */ 1, + /* a = */ 1, + /* b = */ "42" ) check( - /* c = */ 2, - /* c2 = */ 3,/* d = */ "24", + /* c = */ 2, + /* c2 = */ 3,/* d = */ "24", ) check( - 2, 3, "24", /* custom block comment */ + 2, 3, "24", /* custom block comment */ ) check( - 2, 3, "24", // custom EOL comment + 2, 3, "24", // custom EOL comment ) check( - 2, 3, "24" /* custom block comment */ + 2, 3, "24" /* custom block comment */ ) check( - 2, 3, "24" // custom EOL comment + 2, 3, "24" // custom EOL comment ) check( - 2, 3, /* custom block comment */ - "24", /* custom block comment */ + 2, 3, /* custom block comment */ + "24", /* custom block comment */ ) check( - 2, 3, // custom EOL comment - "24", // custom EOL comment + 2, 3, // custom EOL comment + "24", // custom EOL comment ) check( - 2, 3, /* custom block comment */ - "24" /* custom block comment */ + 2, 3, /* custom block comment */ + "24" /* custom block comment */ ) check( - 2, 3, // custom EOL comment - "24" // custom EOL comment + 2, 3, // custom EOL comment + "24" // custom EOL comment ) } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/NamedArguments.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/NamedArguments.after.kt index 59301054fd7c..134e48c3cedd 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/NamedArguments.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueArguments/NamedArguments.after.kt @@ -1,49 +1,49 @@ fun check() { check( - /* a = */ 1, - /* a = */ 1, - /* b = */ "42" + /* a = */ 1, + /* a = */ 1, + /* b = */ "42" ) check( - /* c = */ 2, - /* c2 = */ 3,/* d = */ "24", + /* c = */ 2, + /* c2 = */ 3,/* d = */ "24", ) check( - 2, 3, "24", /* custom block comment */ + 2, 3, "24", /* custom block comment */ ) check( - 2, 3, "24", // custom EOL comment + 2, 3, "24", // custom EOL comment ) check( - 2, 3, "24" /* custom block comment */ + 2, 3, "24" /* custom block comment */ ) check( - 2, 3, "24" // custom EOL comment + 2, 3, "24" // custom EOL comment ) check( - 2, 3, /* custom block comment */ - "24", /* custom block comment */ + 2, 3, /* custom block comment */ + "24", /* custom block comment */ ) check( - 2, 3, // custom EOL comment - "24", // custom EOL comment + 2, 3, // custom EOL comment + "24", // custom EOL comment ) check( - 2, 3, /* custom block comment */ - "24" /* custom block comment */ + 2, 3, /* custom block comment */ + "24" /* custom block comment */ ) check( - 2, 3, // custom EOL comment - "24" // custom EOL comment + 2, 3, // custom EOL comment + "24" // custom EOL comment ) } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/LambdaValueParameters.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/LambdaValueParameters.after.inv.kt index 3ef86d4002bd..fdef1aa9939a 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/LambdaValueParameters.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/LambdaValueParameters.after.inv.kt @@ -1,14 +1,14 @@ fun main() { val x: ( - y: Comparable>, - z: Iterable> // trailing comma + y: Comparable>, + z: Iterable> // trailing comma ) -> Int = { 10 } val x: ( - y: Comparable>, - z: Iterable> + y: Comparable>, + z: Iterable> ) -> Int = { 10 } @@ -22,7 +22,7 @@ fun main() { } val x: ( - y: Comparable>, z: Iterable>, + y: Comparable>, z: Iterable>, ) -> Int = { 10 } @@ -35,36 +35,39 @@ fun main() { 10 } - val x: (y: Comparable> + val x: ( + y: Comparable> ) -> Int = { 10 } val x: ( - y: Comparable>) -> Int = { - 10 - } - - val x: ( - y: Comparable>, // - z: Iterable> // /**/ - ) -> Int = { - 10 - } - - val x: (y: Comparable>, z: Iterable> - // wd + y: Comparable> ) -> Int = { 10 } val x: ( - y: Comparable>, - /* + y: Comparable>, // + z: Iterable> // /**/ + ) -> Int = { + 10 + } + + val x: ( + y: Comparable>, z: Iterable> + // wd + ) -> Int = { + 10 + } + + val x: ( + y: Comparable>, + /* + */ + z: Iterable>, + /* // */ - z: Iterable>, - /* // - */ ) -> Int = { 10 } @@ -77,13 +80,15 @@ fun main() { 10 } - val x: (y: Comparable> + val x: ( + y: Comparable> ) -> Int = { 10 } val x: ( /* - */y: Comparable>) -> Int = { + */y: Comparable> + ) -> Int = { 10 } } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/LambdaValueParameters.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/LambdaValueParameters.after.kt index f302c2cebec2..26647c7ffdfb 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/LambdaValueParameters.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/LambdaValueParameters.after.kt @@ -1,14 +1,14 @@ fun main() { val x: ( - y: Comparable>, - z: Iterable>, // trailing comma + y: Comparable>, + z: Iterable>, // trailing comma ) -> Int = { 10 } val x: ( - y: Comparable>, - z: Iterable>, + y: Comparable>, + z: Iterable>, ) -> Int = { 10 } @@ -22,7 +22,7 @@ fun main() { } val x: ( - y: Comparable>, z: Iterable>, + y: Comparable>, z: Iterable>, ) -> Int = { 10 } @@ -36,39 +36,39 @@ fun main() { } val x: ( - y: Comparable>, + y: Comparable>, ) -> Int = { 10 } val x: ( - y: Comparable>, + y: Comparable>, ) -> Int = { 10 } val x: ( - y: Comparable>, // - z: Iterable>, // /**/ + y: Comparable>, // + z: Iterable>, // /**/ ) -> Int = { 10 } val x: ( - y: Comparable>, - z: Iterable>, - // wd + y: Comparable>, + z: Iterable>, + // wd ) -> Int = { 10 } val x: ( - y: Comparable>, - /* + y: Comparable>, + /* + */ + z: Iterable>, + /* // */ - z: Iterable>, - /* // - */ ) -> Int = { 10 } @@ -82,15 +82,15 @@ fun main() { } val x: ( - y: Comparable>, + y: Comparable>, ) -> Int = { 10 } val x: ( - /* - */ - y: Comparable>, + /* + */ + y: Comparable>, ) -> Int = { 10 } diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/NamedParameters.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/NamedParameters.after.inv.kt index 8616767c9988..b3bdc8a496df 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/NamedParameters.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/NamedParameters.after.inv.kt @@ -1,13 +1,13 @@ fun check( - /* a */ a: Int, // custom EOL comment - /* ad */ s: Int, /* custom EOL comment*/ - /* b */ b: String, // custom EOL comment + /* a */ a: Int, // custom EOL comment + /* ad */ s: Int, /* custom EOL comment*/ + /* b */ b: String, // custom EOL comment ) = Unit fun check( - /* a */ a: Int, // custom EOL comment - /* ad */ s: Int, /* custom EOL comment*/ - /* b */ b: String, /* custom EOL comment*/ + /* a */ a: Int, // custom EOL comment + /* ad */ s: Int, /* custom EOL comment*/ + /* b */ b: String, /* custom EOL comment*/ ) = Unit // SET_FALSE: ALLOW_TRAILING_COMMA diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/NamedParameters.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/NamedParameters.after.kt index d288f693a1ae..7da5811eca54 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/NamedParameters.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/NamedParameters.after.kt @@ -4,9 +4,9 @@ fun check(/* a */ a: Int, // custom EOL comment ) = Unit fun check( - /* a */ a: Int, // custom EOL comment - /* ad */ s: Int, /* custom EOL comment*/ - /* b */ b: String, /* custom EOL comment*/ + /* a */ a: Int, // custom EOL comment + /* ad */ s: Int, /* custom EOL comment*/ + /* b */ b: String, /* custom EOL comment*/ ) = Unit // SET_FALSE: ALLOW_TRAILING_COMMA diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListChopAsNeeded.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListChopAsNeeded.after.inv.kt index cabcbdc9ad47..8aec077e48cb 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListChopAsNeeded.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListChopAsNeeded.after.inv.kt @@ -3,8 +3,8 @@ class A1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -16,8 +16,8 @@ class B1 { val y: String constructor( - x: String, - y: String + x: String, + y: String ) { this.x = x this.y = y @@ -29,8 +29,8 @@ class C1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -42,8 +42,8 @@ class D1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -56,9 +56,9 @@ class A2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -72,9 +72,9 @@ class B2 { val z: String constructor( - x: String, - y: String, - z: String + x: String, + y: String, + z: String ) { this.x = x this.y = y @@ -88,9 +88,9 @@ class C2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -104,9 +104,9 @@ class D2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -134,7 +134,7 @@ class C3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -144,7 +144,7 @@ class D3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -156,8 +156,8 @@ class E1 { val z: String constructor( - x: String, - y: String, z: String, + x: String, + y: String, z: String, ) { this.x = x this.y = y @@ -171,8 +171,9 @@ class E2 { val z: String constructor( - x: String, - y: String, z: String) { + x: String, + y: String, z: String + ) { this.x = x this.y = y this.z = z @@ -180,128 +181,128 @@ class E2 { } class A1( - val x: String, - y: String, + val x: String, + y: String, ) class B1( - val x: String, - val y: String + val x: String, + val y: String ) class C1( - val x: String, - val y: String, + val x: String, + val y: String, ) class D1( - val x: String, - val y: String, + val x: String, + val y: String, ) class A2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B2( - val x: String, - val y: String, - val z: String + val x: String, + val y: String, + val z: String ) class C2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class A3( - val x: String, + val x: String, ) class B3( - val x: String + val x: String ) class C3( - val x: String, + val x: String, ) class D3( - val x: String, + val x: String, ) class A4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B4( - val x: String, - val y: String, - val z: String + val x: String, + val y: String, + val z: String ) class C4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class E1( - val x: String, val y: String, - val z: String, + val x: String, val y: String, + val z: String, ) class E2( - val x: String, val y: String, val z: String + val x: String, val y: String, val z: String ) class C( - z: String, val v: Int, val x: Int = - 42, val y: Int = - 42 + z: String, val v: Int, val x: Int = + 42, val y: Int = + 42 ) val foo1: (Int, Int) -> Int = fun( - x, - y, + x, + y, ): Int = 42 val foo2: (Int, Int) -> Int = fun( - x, - y + x, + y ): Int { return x + y } val foo3: (Int, Int) -> Int = fun( - x, y, + x, y, ): Int { return x + y } val foo4: (Int) -> Int = fun( - x, + x, ): Int = 42 val foo5: (Int) -> Int = fun( - x + x ): Int = 42 val foo6: (Int) -> Int = fun(x): Int = 42 @@ -313,168 +314,168 @@ val foo8: (Int, Int, Int) -> Int = fun(x, y: Int, z): Int { } val foo9: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z, + x, + y: Int, + z, ): Int = 42 val foo10: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z: Int + x, + y: Int, + z: Int ): Int = 43 val foo10 = fun( - x: Int, - y: Int, - z: Int + x: Int, + y: Int, + z: Int ): Int = 43 val foo11 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 val foo12 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 val foo13 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 val foo14 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 fun a1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun b1( - x: String, - y: String + x: String, + y: String ) = Unit fun c1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun d1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun a2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b2( - x: String, - y: String, - z: String + x: String, + y: String, + z: String ) = Unit fun c2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun a3( - x: String, + x: String, ) = Unit fun b3( - x: String + x: String ) = Unit fun c3( - x: String, + x: String, ) = Unit fun d3( - x: String, + x: String, ) = Unit fun a4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b4( - x: String, - y: String, - z: String + x: String, + y: String, + z: String ) = Unit fun c4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun foo( - x: Int = - 42 + x: Int = + 42 ) { } class C( - val x: Int = - 42 + val x: Int = + 42 ) class G( - val x: String, val y: String - = "", /* */ val z: String + val x: String, val y: String + = "", /* */ val z: String ) class G( - val x: String, val y: String - = "" /* */, /* */ val z: String + val x: String, val y: String + = "" /* */, /* */ val z: String ) class H( - val x: String, - /* - */ - val y: String, - val z: String, + val x: String, + /* + */ + val y: String, + val z: String, ) class J( - val x: String, val y: String, - val z: String, - /* + val x: String, val y: String, + val z: String, + /* */ ) class K( - val x: String, val y: String, - val z: String, + val x: String, val y: String, + val z: String, ) class L( - val x: String, val y: String, val z: String // adwd + val x: String, val y: String, val z: String // adwd ) // SET_TRUE: ALLOW_TRAILING_COMMA diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListChopAsNeeded.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListChopAsNeeded.after.kt index 81ace7074a9b..6304f67a753f 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListChopAsNeeded.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListChopAsNeeded.after.kt @@ -3,8 +3,8 @@ class A1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -16,8 +16,8 @@ class B1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -29,8 +29,8 @@ class C1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -42,8 +42,8 @@ class D1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -56,9 +56,9 @@ class A2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -72,9 +72,9 @@ class B2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -88,9 +88,9 @@ class C2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -104,9 +104,9 @@ class D2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -134,7 +134,7 @@ class C3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -144,7 +144,7 @@ class D3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -156,8 +156,8 @@ class E1 { val z: String constructor( - x: String, - y: String, z: String, + x: String, + y: String, z: String, ) { this.x = x this.y = y @@ -171,8 +171,8 @@ class E2 { val z: String constructor( - x: String, - y: String, z: String, + x: String, + y: String, z: String, ) { this.x = x this.y = y @@ -181,130 +181,130 @@ class E2 { } class A1( - val x: String, - y: String, + val x: String, + y: String, ) class B1( - val x: String, - val y: String, + val x: String, + val y: String, ) class C1( - val x: String, - val y: String, + val x: String, + val y: String, ) class D1( - val x: String, - val y: String, + val x: String, + val y: String, ) class A2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class C2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class A3( - val x: String, + val x: String, ) class B3( - val x: String, + val x: String, ) class C3( - val x: String, + val x: String, ) class D3( - val x: String, + val x: String, ) class A4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class C4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class E1( - val x: String, val y: String, - val z: String, + val x: String, val y: String, + val z: String, ) class E2( - val x: String, val y: String, val z: String, + val x: String, val y: String, val z: String, ) class C( - z: String, val v: Int, - val x: Int = - 42, - val y: Int = - 42, + z: String, val v: Int, + val x: Int = + 42, + val y: Int = + 42, ) val foo1: (Int, Int) -> Int = fun( - x, - y, + x, + y, ): Int = 42 val foo2: (Int, Int) -> Int = fun( - x, - y, + x, + y, ): Int { return x + y } val foo3: (Int, Int) -> Int = fun( - x, y, + x, y, ): Int { return x + y } val foo4: (Int) -> Int = fun( - x, + x, ): Int = 42 val foo5: (Int) -> Int = fun( - x, + x, ): Int = 42 val foo6: (Int) -> Int = fun(x): Int = 42 @@ -316,173 +316,173 @@ val foo8: (Int, Int, Int) -> Int = fun(x, y: Int, z): Int { } val foo9: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z, + x, + y: Int, + z, ): Int = 42 val foo10: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z: Int, + x, + y: Int, + z: Int, ): Int = 43 val foo10 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 val foo11 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 val foo12 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 val foo13 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 val foo14 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 fun a1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun b1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun c1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun d1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun a2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun c2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun a3( - x: String, + x: String, ) = Unit fun b3( - x: String, + x: String, ) = Unit fun c3( - x: String, + x: String, ) = Unit fun d3( - x: String, + x: String, ) = Unit fun a4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun c4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun foo( - x: Int = - 42, + x: Int = + 42, ) { } class C( - val x: Int = - 42, + val x: Int = + 42, ) class G( - val x: String, - val y: String - = "", - /* */ val z: String, + val x: String, + val y: String + = "", + /* */ val z: String, ) class G( - val x: String, - val y: String - = "", - /* */ - /* */ val z: String, + val x: String, + val y: String + = "", + /* */ + /* */ val z: String, ) class H( - val x: String, - /* - */ - val y: String, - val z: String, + val x: String, + /* + */ + val y: String, + val z: String, ) class J( - val x: String, val y: String, - val z: String, - /* + val x: String, val y: String, + val z: String, + /* */ ) class K( - val x: String, val y: String, - val z: String, + val x: String, val y: String, + val z: String, ) class L( - val x: String, val y: String, val z: String, // adwd + val x: String, val y: String, val z: String, // adwd ) // SET_TRUE: ALLOW_TRAILING_COMMA diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListDoNotWrap.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListDoNotWrap.after.inv.kt index d0768552a910..0626cd7db83e 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListDoNotWrap.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListDoNotWrap.after.inv.kt @@ -3,8 +3,8 @@ class A1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -16,8 +16,8 @@ class B1 { val y: String constructor( - x: String, - y: String + x: String, + y: String ) { this.x = x this.y = y @@ -29,8 +29,8 @@ class C1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -42,8 +42,8 @@ class D1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -56,9 +56,9 @@ class A2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -72,9 +72,9 @@ class B2 { val z: String constructor( - x: String, - y: String, - z: String + x: String, + y: String, + z: String ) { this.x = x this.y = y @@ -88,9 +88,9 @@ class C2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -104,9 +104,9 @@ class D2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -134,7 +134,7 @@ class C3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -144,7 +144,7 @@ class D3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -156,8 +156,8 @@ class E1 { val z: String constructor( - x: String, - y: String, z: String, + x: String, + y: String, z: String, ) { this.x = x this.y = y @@ -171,8 +171,9 @@ class E2 { val z: String constructor( - x: String, - y: String, z: String) { + x: String, + y: String, z: String + ) { this.x = x this.y = y this.z = z @@ -180,128 +181,128 @@ class E2 { } class A1( - val x: String, - y: String, + val x: String, + y: String, ) class B1( - val x: String, - val y: String + val x: String, + val y: String ) class C1( - val x: String, - val y: String, + val x: String, + val y: String, ) class D1( - val x: String, - val y: String, + val x: String, + val y: String, ) class A2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B2( - val x: String, - val y: String, - val z: String + val x: String, + val y: String, + val z: String ) class C2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class A3( - val x: String, + val x: String, ) class B3( - val x: String + val x: String ) class C3( - val x: String, + val x: String, ) class D3( - val x: String, + val x: String, ) class A4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B4( - val x: String, - val y: String, - val z: String + val x: String, + val y: String, + val z: String ) class C4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class E1( - val x: String, val y: String, - val z: String, + val x: String, val y: String, + val z: String, ) class E2( - val x: String, val y: String, val z: String + val x: String, val y: String, val z: String ) class C( - z: String, val v: Int, val x: Int = - 42, val y: Int = - 42 + z: String, val v: Int, val x: Int = + 42, val y: Int = + 42 ) val foo1: (Int, Int) -> Int = fun( - x, - y, + x, + y, ): Int = 42 val foo2: (Int, Int) -> Int = fun( - x, - y + x, + y ): Int { return x + y } val foo3: (Int, Int) -> Int = fun( - x, y, + x, y, ): Int { return x + y } val foo4: (Int) -> Int = fun( - x, + x, ): Int = 42 val foo5: (Int) -> Int = fun( - x + x ): Int = 42 val foo6: (Int) -> Int = fun(x): Int = 42 @@ -313,168 +314,168 @@ val foo8: (Int, Int, Int) -> Int = fun(x, y: Int, z): Int { } val foo9: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z, + x, + y: Int, + z, ): Int = 42 val foo10: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z: Int + x, + y: Int, + z: Int ): Int = 43 val foo10 = fun( - x: Int, - y: Int, - z: Int + x: Int, + y: Int, + z: Int ): Int = 43 val foo11 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 val foo12 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 val foo13 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 val foo14 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 fun a1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun b1( - x: String, - y: String + x: String, + y: String ) = Unit fun c1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun d1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun a2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b2( - x: String, - y: String, - z: String + x: String, + y: String, + z: String ) = Unit fun c2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun a3( - x: String, + x: String, ) = Unit fun b3( - x: String + x: String ) = Unit fun c3( - x: String, + x: String, ) = Unit fun d3( - x: String, + x: String, ) = Unit fun a4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b4( - x: String, - y: String, - z: String + x: String, + y: String, + z: String ) = Unit fun c4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun foo( - x: Int = - 42 + x: Int = + 42 ) { } class C( - val x: Int = - 42 + val x: Int = + 42 ) class G( - val x: String, val y: String - = "", /* */ val z: String + val x: String, val y: String + = "", /* */ val z: String ) class G( - val x: String, val y: String - = "" /* */, /* */ val z: String + val x: String, val y: String + = "" /* */, /* */ val z: String ) class H( - val x: String, - /* - */ - val y: String, - val z: String, + val x: String, + /* + */ + val y: String, + val z: String, ) class J( - val x: String, val y: String, - val z: String, - /* + val x: String, val y: String, + val z: String, + /* */ ) class K( - val x: String, val y: String, - val z: String, + val x: String, val y: String, + val z: String, ) class L( - val x: String, val y: String, val z: String // adwd + val x: String, val y: String, val z: String // adwd ) // SET_TRUE: ALLOW_TRAILING_COMMA diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListDoNotWrap.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListDoNotWrap.after.kt index 46f9dae6d15e..8d1838992adb 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListDoNotWrap.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListDoNotWrap.after.kt @@ -3,8 +3,8 @@ class A1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -16,8 +16,8 @@ class B1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -29,8 +29,8 @@ class C1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -42,8 +42,8 @@ class D1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -56,9 +56,9 @@ class A2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -72,9 +72,9 @@ class B2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -88,9 +88,9 @@ class C2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -104,9 +104,9 @@ class D2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -134,7 +134,7 @@ class C3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -144,7 +144,7 @@ class D3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -156,8 +156,8 @@ class E1 { val z: String constructor( - x: String, - y: String, z: String, + x: String, + y: String, z: String, ) { this.x = x this.y = y @@ -171,8 +171,8 @@ class E2 { val z: String constructor( - x: String, - y: String, z: String, + x: String, + y: String, z: String, ) { this.x = x this.y = y @@ -181,130 +181,130 @@ class E2 { } class A1( - val x: String, - y: String, + val x: String, + y: String, ) class B1( - val x: String, - val y: String, + val x: String, + val y: String, ) class C1( - val x: String, - val y: String, + val x: String, + val y: String, ) class D1( - val x: String, - val y: String, + val x: String, + val y: String, ) class A2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class C2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class A3( - val x: String, + val x: String, ) class B3( - val x: String, + val x: String, ) class C3( - val x: String, + val x: String, ) class D3( - val x: String, + val x: String, ) class A4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class C4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class E1( - val x: String, val y: String, - val z: String, + val x: String, val y: String, + val z: String, ) class E2( - val x: String, val y: String, val z: String, + val x: String, val y: String, val z: String, ) class C( - z: String, val v: Int, - val x: Int = - 42, - val y: Int = - 42, + z: String, val v: Int, + val x: Int = + 42, + val y: Int = + 42, ) val foo1: (Int, Int) -> Int = fun( - x, - y, + x, + y, ): Int = 42 val foo2: (Int, Int) -> Int = fun( - x, - y, + x, + y, ): Int { return x + y } val foo3: (Int, Int) -> Int = fun( - x, y, + x, y, ): Int { return x + y } val foo4: (Int) -> Int = fun( - x, + x, ): Int = 42 val foo5: (Int) -> Int = fun( - x, + x, ): Int = 42 val foo6: (Int) -> Int = fun(x): Int = 42 @@ -316,173 +316,173 @@ val foo8: (Int, Int, Int) -> Int = fun(x, y: Int, z): Int { } val foo9: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z, + x, + y: Int, + z, ): Int = 42 val foo10: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z: Int, + x, + y: Int, + z: Int, ): Int = 43 val foo10 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 val foo11 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 val foo12 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 val foo13 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 val foo14 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 fun a1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun b1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun c1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun d1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun a2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun c2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun a3( - x: String, + x: String, ) = Unit fun b3( - x: String, + x: String, ) = Unit fun c3( - x: String, + x: String, ) = Unit fun d3( - x: String, + x: String, ) = Unit fun a4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun c4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun foo( - x: Int = - 42, + x: Int = + 42, ) { } class C( - val x: Int = - 42, + val x: Int = + 42, ) class G( - val x: String, - val y: String - = "", - /* */ val z: String, + val x: String, + val y: String + = "", + /* */ val z: String, ) class G( - val x: String, - val y: String - = "", - /* */ - /* */ val z: String, + val x: String, + val y: String + = "", + /* */ + /* */ val z: String, ) class H( - val x: String, - /* - */ - val y: String, - val z: String, + val x: String, + /* + */ + val y: String, + val z: String, ) class J( - val x: String, val y: String, - val z: String, - /* + val x: String, val y: String, + val z: String, + /* */ ) class K( - val x: String, val y: String, - val z: String, + val x: String, val y: String, + val z: String, ) class L( - val x: String, val y: String, val z: String, // adwd + val x: String, val y: String, val z: String, // adwd ) // SET_TRUE: ALLOW_TRAILING_COMMA diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAlways.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAlways.after.inv.kt index 1db2bf9bf1ce..239c1896d6a7 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAlways.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAlways.after.inv.kt @@ -3,8 +3,8 @@ class A1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -16,8 +16,8 @@ class B1 { val y: String constructor( - x: String, - y: String + x: String, + y: String ) { this.x = x this.y = y @@ -29,8 +29,8 @@ class C1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -42,8 +42,8 @@ class D1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -56,9 +56,9 @@ class A2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -72,9 +72,9 @@ class B2 { val z: String constructor( - x: String, - y: String, - z: String + x: String, + y: String, + z: String ) { this.x = x this.y = y @@ -88,9 +88,9 @@ class C2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -104,9 +104,9 @@ class D2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -134,7 +134,7 @@ class C3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -144,7 +144,7 @@ class D3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -156,9 +156,9 @@ class E1 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -172,9 +172,10 @@ class E2 { val z: String constructor( - x: String, - y: String, - z: String) { + x: String, + y: String, + z: String + ) { this.x = x this.y = y this.z = z @@ -182,135 +183,135 @@ class E2 { } class A1( - val x: String, - y: String, + val x: String, + y: String, ) class B1( - val x: String, - val y: String + val x: String, + val y: String ) class C1( - val x: String, - val y: String, + val x: String, + val y: String, ) class D1( - val x: String, - val y: String, + val x: String, + val y: String, ) class A2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B2( - val x: String, - val y: String, - val z: String + val x: String, + val y: String, + val z: String ) class C2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class A3( - val x: String, + val x: String, ) class B3( - val x: String + val x: String ) class C3( - val x: String, + val x: String, ) class D3( - val x: String, + val x: String, ) class A4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B4( - val x: String, - val y: String, - val z: String + val x: String, + val y: String, + val z: String ) class C4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class E1( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class E2( - val x: String, - val y: String, - val z: String + val x: String, + val y: String, + val z: String ) class C( - z: String, - val v: Int, - val x: Int = - 42, - val y: Int = - 42 + z: String, + val v: Int, + val x: Int = + 42, + val y: Int = + 42 ) val foo1: (Int, Int) -> Int = fun( - x, - y, + x, + y, ): Int = 42 val foo2: (Int, Int) -> Int = fun( - x, - y + x, + y ): Int { return x + y } val foo3: (Int, Int) -> Int = fun( - x, - y, + x, + y, ): Int { return x + y } val foo4: (Int) -> Int = fun( - x, + x, ): Int = 42 val foo5: (Int) -> Int = fun( - x + x ): Int = 42 val foo6: (Int) -> Int = fun(x): Int = 42 @@ -318,190 +319,190 @@ val foo6: (Int) -> Int = fun(x): Int = 42 val foo7: (Int) -> Int = fun(x): Int = 42 val foo8: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z, + x, + y: Int, + z, ): Int { return x + y } val foo9: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z, + x, + y: Int, + z, ): Int = 42 val foo10: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z: Int + x, + y: Int, + z: Int ): Int = 43 val foo10 = fun( - x: Int, - y: Int, - z: Int + x: Int, + y: Int, + z: Int ): Int = 43 val foo11 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 val foo12 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 val foo13 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 val foo14 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 fun a1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun b1( - x: String, - y: String + x: String, + y: String ) = Unit fun c1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun d1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun a2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b2( - x: String, - y: String, - z: String + x: String, + y: String, + z: String ) = Unit fun c2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun a3( - x: String, + x: String, ) = Unit fun b3( - x: String + x: String ) = Unit fun c3( - x: String, + x: String, ) = Unit fun d3( - x: String, + x: String, ) = Unit fun a4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b4( - x: String, - y: String, - z: String + x: String, + y: String, + z: String ) = Unit fun c4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun foo( - x: Int = - 42 + x: Int = + 42 ) { } class C( - val x: Int = - 42 + val x: Int = + 42 ) class G( - val x: String, - val y: String - = "", /* */ - val z: String + val x: String, + val y: String + = "", /* */ + val z: String ) class G( - val x: String, - val y: String - = "" /* */, /* */ - val z: String + val x: String, + val y: String + = "" /* */, /* */ + val z: String ) class H( - val x: String, - /* - */ - val y: String, - val z: String, + val x: String, + /* + */ + val y: String, + val z: String, ) class J( - val x: String, - val y: String, - val z: String, - /* + val x: String, + val y: String, + val z: String, + /* */ ) class K( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class L( - val x: String, - val y: String, - val z: String // adwd + val x: String, + val y: String, + val z: String // adwd ) // SET_TRUE: ALLOW_TRAILING_COMMA diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAlways.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAlways.after.kt index 294c59e30fc6..11411c634069 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAlways.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAlways.after.kt @@ -3,8 +3,8 @@ class A1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -16,8 +16,8 @@ class B1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -29,8 +29,8 @@ class C1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -42,8 +42,8 @@ class D1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -56,9 +56,9 @@ class A2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -72,9 +72,9 @@ class B2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -88,9 +88,9 @@ class C2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -104,9 +104,9 @@ class D2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -134,7 +134,7 @@ class C3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -144,7 +144,7 @@ class D3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -156,9 +156,9 @@ class E1 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -172,9 +172,9 @@ class E2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -183,135 +183,135 @@ class E2 { } class A1( - val x: String, - y: String, + val x: String, + y: String, ) class B1( - val x: String, - val y: String, + val x: String, + val y: String, ) class C1( - val x: String, - val y: String, + val x: String, + val y: String, ) class D1( - val x: String, - val y: String, + val x: String, + val y: String, ) class A2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class C2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class A3( - val x: String, + val x: String, ) class B3( - val x: String, + val x: String, ) class C3( - val x: String, + val x: String, ) class D3( - val x: String, + val x: String, ) class A4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class C4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class E1( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class E2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class C( - z: String, - val v: Int, - val x: Int = - 42, - val y: Int = - 42, + z: String, + val v: Int, + val x: Int = + 42, + val y: Int = + 42, ) val foo1: (Int, Int) -> Int = fun( - x, - y, + x, + y, ): Int = 42 val foo2: (Int, Int) -> Int = fun( - x, - y, + x, + y, ): Int { return x + y } val foo3: (Int, Int) -> Int = fun( - x, - y, + x, + y, ): Int { return x + y } val foo4: (Int) -> Int = fun( - x, + x, ): Int = 42 val foo5: (Int) -> Int = fun( - x, + x, ): Int = 42 val foo6: (Int) -> Int = fun(x): Int = 42 @@ -319,193 +319,193 @@ val foo6: (Int) -> Int = fun(x): Int = 42 val foo7: (Int) -> Int = fun(x): Int = 42 val foo8: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z, + x, + y: Int, + z, ): Int { return x + y } val foo9: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z, + x, + y: Int, + z, ): Int = 42 val foo10: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z: Int, + x, + y: Int, + z: Int, ): Int = 43 val foo10 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 val foo11 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 val foo12 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 val foo13 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 val foo14 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 fun a1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun b1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun c1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun d1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun a2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun c2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun a3( - x: String, + x: String, ) = Unit fun b3( - x: String, + x: String, ) = Unit fun c3( - x: String, + x: String, ) = Unit fun d3( - x: String, + x: String, ) = Unit fun a4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun c4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun foo( - x: Int = - 42, + x: Int = + 42, ) { } class C( - val x: Int = - 42, + val x: Int = + 42, ) class G( - val x: String, - val y: String - = "", - /* */ - val z: String, + val x: String, + val y: String + = "", + /* */ + val z: String, ) class G( - val x: String, - val y: String - = "", - /* */ - /* */ - val z: String, + val x: String, + val y: String + = "", + /* */ + /* */ + val z: String, ) class H( - val x: String, - /* - */ - val y: String, - val z: String, + val x: String, + /* + */ + val y: String, + val z: String, ) class J( - val x: String, - val y: String, - val z: String, - /* + val x: String, + val y: String, + val z: String, + /* */ ) class K( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class L( - val x: String, - val y: String, - val z: String, // adwd + val x: String, + val y: String, + val z: String, // adwd ) // SET_TRUE: ALLOW_TRAILING_COMMA diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAsNeeded.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAsNeeded.after.inv.kt index 44fa1031ba99..cf5afdc61b44 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAsNeeded.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAsNeeded.after.inv.kt @@ -3,8 +3,8 @@ class A1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -16,8 +16,8 @@ class B1 { val y: String constructor( - x: String, - y: String + x: String, + y: String ) { this.x = x this.y = y @@ -29,8 +29,8 @@ class C1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -42,8 +42,8 @@ class D1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -56,9 +56,9 @@ class A2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -72,9 +72,9 @@ class B2 { val z: String constructor( - x: String, - y: String, - z: String + x: String, + y: String, + z: String ) { this.x = x this.y = y @@ -88,9 +88,9 @@ class C2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -104,9 +104,9 @@ class D2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -134,7 +134,7 @@ class C3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -144,7 +144,7 @@ class D3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -156,8 +156,8 @@ class E1 { val z: String constructor( - x: String, - y: String, z: String, + x: String, + y: String, z: String, ) { this.x = x this.y = y @@ -171,8 +171,9 @@ class E2 { val z: String constructor( - x: String, - y: String, z: String) { + x: String, + y: String, z: String + ) { this.x = x this.y = y this.z = z @@ -180,128 +181,128 @@ class E2 { } class A1( - val x: String, - y: String, + val x: String, + y: String, ) class B1( - val x: String, - val y: String + val x: String, + val y: String ) class C1( - val x: String, - val y: String, + val x: String, + val y: String, ) class D1( - val x: String, - val y: String, + val x: String, + val y: String, ) class A2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B2( - val x: String, - val y: String, - val z: String + val x: String, + val y: String, + val z: String ) class C2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class A3( - val x: String, + val x: String, ) class B3( - val x: String + val x: String ) class C3( - val x: String, + val x: String, ) class D3( - val x: String, + val x: String, ) class A4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B4( - val x: String, - val y: String, - val z: String + val x: String, + val y: String, + val z: String ) class C4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class E1( - val x: String, val y: String, - val z: String, + val x: String, val y: String, + val z: String, ) class E2( - val x: String, val y: String, val z: String + val x: String, val y: String, val z: String ) class C( - z: String, val v: Int, val x: Int = - 42, val y: Int = - 42 + z: String, val v: Int, val x: Int = + 42, val y: Int = + 42 ) val foo1: (Int, Int) -> Int = fun( - x, - y, + x, + y, ): Int = 42 val foo2: (Int, Int) -> Int = fun( - x, - y + x, + y ): Int { return x + y } val foo3: (Int, Int) -> Int = fun( - x, y, + x, y, ): Int { return x + y } val foo4: (Int) -> Int = fun( - x, + x, ): Int = 42 val foo5: (Int) -> Int = fun( - x + x ): Int = 42 val foo6: (Int) -> Int = fun(x): Int = 42 @@ -313,168 +314,168 @@ val foo8: (Int, Int, Int) -> Int = fun(x, y: Int, z): Int { } val foo9: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z, + x, + y: Int, + z, ): Int = 42 val foo10: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z: Int + x, + y: Int, + z: Int ): Int = 43 val foo10 = fun( - x: Int, - y: Int, - z: Int + x: Int, + y: Int, + z: Int ): Int = 43 val foo11 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 val foo12 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 val foo13 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 val foo14 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 fun a1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun b1( - x: String, - y: String + x: String, + y: String ) = Unit fun c1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun d1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun a2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b2( - x: String, - y: String, - z: String + x: String, + y: String, + z: String ) = Unit fun c2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun a3( - x: String, + x: String, ) = Unit fun b3( - x: String + x: String ) = Unit fun c3( - x: String, + x: String, ) = Unit fun d3( - x: String, + x: String, ) = Unit fun a4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b4( - x: String, - y: String, - z: String + x: String, + y: String, + z: String ) = Unit fun c4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun foo( - x: Int = - 42 + x: Int = + 42 ) { } class C( - val x: Int = - 42 + val x: Int = + 42 ) class G( - val x: String, val y: String - = "", /* */ val z: String + val x: String, val y: String + = "", /* */ val z: String ) class G( - val x: String, val y: String - = "" /* */, /* */ val z: String + val x: String, val y: String + = "" /* */, /* */ val z: String ) class H( - val x: String, - /* - */ - val y: String, - val z: String, + val x: String, + /* + */ + val y: String, + val z: String, ) class J( - val x: String, val y: String, - val z: String, - /* + val x: String, val y: String, + val z: String, + /* */ ) class K( - val x: String, val y: String, - val z: String, + val x: String, val y: String, + val z: String, ) class L( - val x: String, val y: String, val z: String // adwd + val x: String, val y: String, val z: String // adwd ) // SET_TRUE: ALLOW_TRAILING_COMMA diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAsNeeded.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAsNeeded.after.kt index 5a344a31be74..71788e7c2642 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAsNeeded.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAsNeeded.after.kt @@ -3,8 +3,8 @@ class A1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -16,8 +16,8 @@ class B1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -29,8 +29,8 @@ class C1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -42,8 +42,8 @@ class D1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -56,9 +56,9 @@ class A2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -72,9 +72,9 @@ class B2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -88,9 +88,9 @@ class C2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -104,9 +104,9 @@ class D2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -134,7 +134,7 @@ class C3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -144,7 +144,7 @@ class D3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -156,8 +156,8 @@ class E1 { val z: String constructor( - x: String, - y: String, z: String, + x: String, + y: String, z: String, ) { this.x = x this.y = y @@ -171,8 +171,8 @@ class E2 { val z: String constructor( - x: String, - y: String, z: String, + x: String, + y: String, z: String, ) { this.x = x this.y = y @@ -181,130 +181,130 @@ class E2 { } class A1( - val x: String, - y: String, + val x: String, + y: String, ) class B1( - val x: String, - val y: String, + val x: String, + val y: String, ) class C1( - val x: String, - val y: String, + val x: String, + val y: String, ) class D1( - val x: String, - val y: String, + val x: String, + val y: String, ) class A2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class C2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class A3( - val x: String, + val x: String, ) class B3( - val x: String, + val x: String, ) class C3( - val x: String, + val x: String, ) class D3( - val x: String, + val x: String, ) class A4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class C4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class E1( - val x: String, val y: String, - val z: String, + val x: String, val y: String, + val z: String, ) class E2( - val x: String, val y: String, val z: String, + val x: String, val y: String, val z: String, ) class C( - z: String, val v: Int, - val x: Int = - 42, - val y: Int = - 42, + z: String, val v: Int, + val x: Int = + 42, + val y: Int = + 42, ) val foo1: (Int, Int) -> Int = fun( - x, - y, + x, + y, ): Int = 42 val foo2: (Int, Int) -> Int = fun( - x, - y, + x, + y, ): Int { return x + y } val foo3: (Int, Int) -> Int = fun( - x, y, + x, y, ): Int { return x + y } val foo4: (Int) -> Int = fun( - x, + x, ): Int = 42 val foo5: (Int) -> Int = fun( - x, + x, ): Int = 42 val foo6: (Int) -> Int = fun(x): Int = 42 @@ -316,173 +316,173 @@ val foo8: (Int, Int, Int) -> Int = fun(x, y: Int, z): Int { } val foo9: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z, + x, + y: Int, + z, ): Int = 42 val foo10: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z: Int, + x, + y: Int, + z: Int, ): Int = 43 val foo10 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 val foo11 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 val foo12 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 val foo13 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 val foo14 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 fun a1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun b1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun c1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun d1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun a2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun c2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun a3( - x: String, + x: String, ) = Unit fun b3( - x: String, + x: String, ) = Unit fun c3( - x: String, + x: String, ) = Unit fun d3( - x: String, + x: String, ) = Unit fun a4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun c4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun foo( - x: Int = - 42, + x: Int = + 42, ) { } class C( - val x: Int = - 42, + val x: Int = + 42, ) class G( - val x: String, - val y: String - = "", - /* */ val z: String, + val x: String, + val y: String + = "", + /* */ val z: String, ) class G( - val x: String, - val y: String - = "", - /* */ - /* */ val z: String, + val x: String, + val y: String + = "", + /* */ + /* */ val z: String, ) class H( - val x: String, - /* - */ - val y: String, - val z: String, + val x: String, + /* + */ + val y: String, + val z: String, ) class J( - val x: String, val y: String, - val z: String, - /* + val x: String, val y: String, + val z: String, + /* */ ) class K( - val x: String, val y: String, - val z: String, + val x: String, val y: String, + val z: String, ) class L( - val x: String, val y: String, val z: String, // adwd + val x: String, val y: String, val z: String, // adwd ) // SET_TRUE: ALLOW_TRAILING_COMMA diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAsNeeded.call.after.inv.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAsNeeded.call.after.inv.kt index 44fa1031ba99..cf5afdc61b44 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAsNeeded.call.after.inv.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAsNeeded.call.after.inv.kt @@ -3,8 +3,8 @@ class A1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -16,8 +16,8 @@ class B1 { val y: String constructor( - x: String, - y: String + x: String, + y: String ) { this.x = x this.y = y @@ -29,8 +29,8 @@ class C1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -42,8 +42,8 @@ class D1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -56,9 +56,9 @@ class A2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -72,9 +72,9 @@ class B2 { val z: String constructor( - x: String, - y: String, - z: String + x: String, + y: String, + z: String ) { this.x = x this.y = y @@ -88,9 +88,9 @@ class C2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -104,9 +104,9 @@ class D2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -134,7 +134,7 @@ class C3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -144,7 +144,7 @@ class D3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -156,8 +156,8 @@ class E1 { val z: String constructor( - x: String, - y: String, z: String, + x: String, + y: String, z: String, ) { this.x = x this.y = y @@ -171,8 +171,9 @@ class E2 { val z: String constructor( - x: String, - y: String, z: String) { + x: String, + y: String, z: String + ) { this.x = x this.y = y this.z = z @@ -180,128 +181,128 @@ class E2 { } class A1( - val x: String, - y: String, + val x: String, + y: String, ) class B1( - val x: String, - val y: String + val x: String, + val y: String ) class C1( - val x: String, - val y: String, + val x: String, + val y: String, ) class D1( - val x: String, - val y: String, + val x: String, + val y: String, ) class A2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B2( - val x: String, - val y: String, - val z: String + val x: String, + val y: String, + val z: String ) class C2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class A3( - val x: String, + val x: String, ) class B3( - val x: String + val x: String ) class C3( - val x: String, + val x: String, ) class D3( - val x: String, + val x: String, ) class A4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B4( - val x: String, - val y: String, - val z: String + val x: String, + val y: String, + val z: String ) class C4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class E1( - val x: String, val y: String, - val z: String, + val x: String, val y: String, + val z: String, ) class E2( - val x: String, val y: String, val z: String + val x: String, val y: String, val z: String ) class C( - z: String, val v: Int, val x: Int = - 42, val y: Int = - 42 + z: String, val v: Int, val x: Int = + 42, val y: Int = + 42 ) val foo1: (Int, Int) -> Int = fun( - x, - y, + x, + y, ): Int = 42 val foo2: (Int, Int) -> Int = fun( - x, - y + x, + y ): Int { return x + y } val foo3: (Int, Int) -> Int = fun( - x, y, + x, y, ): Int { return x + y } val foo4: (Int) -> Int = fun( - x, + x, ): Int = 42 val foo5: (Int) -> Int = fun( - x + x ): Int = 42 val foo6: (Int) -> Int = fun(x): Int = 42 @@ -313,168 +314,168 @@ val foo8: (Int, Int, Int) -> Int = fun(x, y: Int, z): Int { } val foo9: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z, + x, + y: Int, + z, ): Int = 42 val foo10: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z: Int + x, + y: Int, + z: Int ): Int = 43 val foo10 = fun( - x: Int, - y: Int, - z: Int + x: Int, + y: Int, + z: Int ): Int = 43 val foo11 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 val foo12 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 val foo13 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 val foo14 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 fun a1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun b1( - x: String, - y: String + x: String, + y: String ) = Unit fun c1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun d1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun a2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b2( - x: String, - y: String, - z: String + x: String, + y: String, + z: String ) = Unit fun c2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun a3( - x: String, + x: String, ) = Unit fun b3( - x: String + x: String ) = Unit fun c3( - x: String, + x: String, ) = Unit fun d3( - x: String, + x: String, ) = Unit fun a4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b4( - x: String, - y: String, - z: String + x: String, + y: String, + z: String ) = Unit fun c4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun foo( - x: Int = - 42 + x: Int = + 42 ) { } class C( - val x: Int = - 42 + val x: Int = + 42 ) class G( - val x: String, val y: String - = "", /* */ val z: String + val x: String, val y: String + = "", /* */ val z: String ) class G( - val x: String, val y: String - = "" /* */, /* */ val z: String + val x: String, val y: String + = "" /* */, /* */ val z: String ) class H( - val x: String, - /* - */ - val y: String, - val z: String, + val x: String, + /* + */ + val y: String, + val z: String, ) class J( - val x: String, val y: String, - val z: String, - /* + val x: String, val y: String, + val z: String, + /* */ ) class K( - val x: String, val y: String, - val z: String, + val x: String, val y: String, + val z: String, ) class L( - val x: String, val y: String, val z: String // adwd + val x: String, val y: String, val z: String // adwd ) // SET_TRUE: ALLOW_TRAILING_COMMA diff --git a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAsNeeded.call.after.kt b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAsNeeded.call.after.kt index 5a344a31be74..71788e7c2642 100644 --- a/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAsNeeded.call.after.kt +++ b/plugins/kotlin/idea/tests/testData/formatter/trailingComma/valueParameters/ParameterListWrapAsNeeded.call.after.kt @@ -3,8 +3,8 @@ class A1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -16,8 +16,8 @@ class B1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -29,8 +29,8 @@ class C1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -42,8 +42,8 @@ class D1 { val y: String constructor( - x: String, - y: String, + x: String, + y: String, ) { this.x = x this.y = y @@ -56,9 +56,9 @@ class A2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -72,9 +72,9 @@ class B2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -88,9 +88,9 @@ class C2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -104,9 +104,9 @@ class D2 { val z: String constructor( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) { this.x = x this.y = y @@ -134,7 +134,7 @@ class C3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -144,7 +144,7 @@ class D3 { val x: String constructor( - x: String, + x: String, ) { this.x = x } @@ -156,8 +156,8 @@ class E1 { val z: String constructor( - x: String, - y: String, z: String, + x: String, + y: String, z: String, ) { this.x = x this.y = y @@ -171,8 +171,8 @@ class E2 { val z: String constructor( - x: String, - y: String, z: String, + x: String, + y: String, z: String, ) { this.x = x this.y = y @@ -181,130 +181,130 @@ class E2 { } class A1( - val x: String, - y: String, + val x: String, + y: String, ) class B1( - val x: String, - val y: String, + val x: String, + val y: String, ) class C1( - val x: String, - val y: String, + val x: String, + val y: String, ) class D1( - val x: String, - val y: String, + val x: String, + val y: String, ) class A2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class C2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D2( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class A3( - val x: String, + val x: String, ) class B3( - val x: String, + val x: String, ) class C3( - val x: String, + val x: String, ) class D3( - val x: String, + val x: String, ) class A4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class B4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class C4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class D4( - val x: String, - val y: String, - val z: String, + val x: String, + val y: String, + val z: String, ) class E1( - val x: String, val y: String, - val z: String, + val x: String, val y: String, + val z: String, ) class E2( - val x: String, val y: String, val z: String, + val x: String, val y: String, val z: String, ) class C( - z: String, val v: Int, - val x: Int = - 42, - val y: Int = - 42, + z: String, val v: Int, + val x: Int = + 42, + val y: Int = + 42, ) val foo1: (Int, Int) -> Int = fun( - x, - y, + x, + y, ): Int = 42 val foo2: (Int, Int) -> Int = fun( - x, - y, + x, + y, ): Int { return x + y } val foo3: (Int, Int) -> Int = fun( - x, y, + x, y, ): Int { return x + y } val foo4: (Int) -> Int = fun( - x, + x, ): Int = 42 val foo5: (Int) -> Int = fun( - x, + x, ): Int = 42 val foo6: (Int) -> Int = fun(x): Int = 42 @@ -316,173 +316,173 @@ val foo8: (Int, Int, Int) -> Int = fun(x, y: Int, z): Int { } val foo9: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z, + x, + y: Int, + z, ): Int = 42 val foo10: (Int, Int, Int) -> Int = fun( - x, - y: Int, - z: Int, + x, + y: Int, + z: Int, ): Int = 43 val foo10 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 val foo11 = fun( - x: Int, - y: Int, - z: Int, + x: Int, + y: Int, + z: Int, ): Int = 43 val foo12 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 val foo13 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 val foo14 = fun( - x: Int, y: Int, z: Int, + x: Int, y: Int, z: Int, ): Int = 43 fun a1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun b1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun c1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun d1( - x: String, - y: String, + x: String, + y: String, ) = Unit fun a2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun c2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d2( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun a3( - x: String, + x: String, ) = Unit fun b3( - x: String, + x: String, ) = Unit fun c3( - x: String, + x: String, ) = Unit fun d3( - x: String, + x: String, ) = Unit fun a4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun b4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun c4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun d4( - x: String, - y: String, - z: String, + x: String, + y: String, + z: String, ) = Unit fun foo( - x: Int = - 42, + x: Int = + 42, ) { } class C( - val x: Int = - 42, + val x: Int = + 42, ) class G( - val x: String, - val y: String - = "", - /* */ val z: String, + val x: String, + val y: String + = "", + /* */ val z: String, ) class G( - val x: String, - val y: String - = "", - /* */ - /* */ val z: String, + val x: String, + val y: String + = "", + /* */ + /* */ val z: String, ) class H( - val x: String, - /* - */ - val y: String, - val z: String, + val x: String, + /* + */ + val y: String, + val z: String, ) class J( - val x: String, val y: String, - val z: String, - /* + val x: String, val y: String, + val z: String, + /* */ ) class K( - val x: String, val y: String, - val z: String, + val x: String, val y: String, + val z: String, ) class L( - val x: String, val y: String, val z: String, // adwd + val x: String, val y: String, val z: String, // adwd ) // SET_TRUE: ALLOW_TRAILING_COMMA