From 11a34829700b46c1b2b15a00ca5ca93e490c999e Mon Sep 17 00:00:00 2001 From: Dmitry Gridin Date: Tue, 28 Apr 2020 15:51:57 +0700 Subject: [PATCH] tests: apply official code style #KT-38632 Fixed --- .../override/ValInConstructorParameter2.kt | 4 +- .../ValInConstructorParameter2.kt.after | 6 +- .../test/SmartEnterCompletionTest.kt | 6 +- .../KotlinLightCodeInsightFixtureTestCase.kt | 15 +- ...LightPlatformCodeInsightFixtureTestCase.kt | 4 +- .../KotlinLightPlatformCodeInsightTestCase.kt | 10 + ...linLightPlatformCodeInsightTestCase.kt.191 | 9 + .../ConversionInCorrectContext.expected.kt | 3 +- .../SeveralMethodsSample.expected.kt | 9 +- .../ImportResolve.expected.kt | 6 +- .../AssignmentAfterEq.after.inv.kt | 2 +- .../AssignmentAfterEq.after.kt | 2 +- .../EmptyParameters.after.kt | 2 +- .../FunctionWithInference.after.kt | 2 +- .../InDelegationListNotEmpty.after.inv.kt | 2 +- .../InLambdaBeforeParams.after.kt | 2 +- .../MultideclarationAfterEq.after.kt | 2 +- .../PropertyWithInference.after.kt | 2 +- .../ifToElvisSwallowComments.kt.after | 4 +- .../branched/ifThenToElvis/longLine.kt.after | 2 +- .../allTransformations.kt.after | 66 ++--- .../convertCallChainIntoSequence/comment.kt | 6 +- .../comment.kt.after | 8 +- .../convertCallChainIntoSequence/comment2.kt | 4 +- .../comment2.kt.after | 8 +- .../noTargetTermination.kt | 6 +- .../noTargetTermination.kt.after | 10 +- .../noTargetTermination2.kt | 10 +- .../noTargetTermination2.kt.after | 14 +- .../nullable.kt.after | 8 +- .../returnAtLabels.kt.after | 14 +- .../simple.kt.after | 3 +- .../convertCallChainIntoSequence/simple2.kt | 8 +- .../simple2.kt.after | 12 +- .../convertCallChainIntoSequence/simple3.kt | 10 +- .../simple3.kt.after | 16 +- .../simple4.kt.after | 8 +- .../termination/filterIndexedTo.kt.after | 3 +- .../termination/mapIndexedNotNullTo.kt.after | 3 +- ...inToStringWithReferenceAndComment.kt.after | 16 +- .../joinToWithComment.kt.after | 14 +- .../listOfNotNullWithComment.kt.after | 4 +- .../saveComment.kt.after | 2 +- .../saveComment2.kt.after | 2 +- .../CommentInBlock.kt.after | 4 +- .../Comments2.kt.after | 6 +- .../LongName.kt.after | 2 +- .../migrateDiagnosticSuppression/multiple.kt | 6 +- .../multiple.kt.after | 6 +- .../trailingComma/addComma.kt.after | 4 +- .../trailingComma/addComma2.kt.after | 4 +- .../trailingComma/addComma5.kt.after | 4 +- .../trailingComma/addComma6.kt.after | 6 +- .../changeCommaPosition.kt.after | 4 +- .../changeCommaPosition2.kt.after | 4 +- .../changeCommaPosition5.kt.after | 4 +- .../trailingComma/missingLineBreak.kt.after | 4 +- .../trailingComma/missingLineBreak2.kt.after | 4 +- .../trailingComma/missingLineBreak3.kt.after | 4 +- .../keepComments/2.kt.after | 2 +- .../keepComments/3.kt.after | 2 +- .../keepComments/4.kt.after | 2 +- .../useExpressionBody/if.kt.after | 12 +- .../useExpressionBody/veryVeryLong.kt.after | 2 +- .../exceptionTextHandlesMultiline.kt.after | 11 +- .../ifToWhen/ifElseSwallowComments.kt.after | 2 +- .../ifToWhen/multipleIfWithReturns.kt.after | 8 +- .../branched/ifWhen/whenToIf/comment.kt.after | 2 +- .../branched/ifWhen/whenToIf/kt12040.kt.after | 5 +- .../chop/argumentList/threeArgs.kt.after | 6 +- .../threeArgsWithTrailingComma.kt.after | 6 +- .../parameterList/hasSomeLineBreaks1.kt.after | 6 +- ...sSomeLineBreaks1WithTrailingComma.kt.after | 6 +- .../parameterList/hasSomeLineBreaks2.kt.after | 6 +- .../parameterList/threeParameters.kt.after | 6 +- .../chop/parameterList/twoParameters.kt.after | 4 +- .../withComments.kt.after | 9 +- .../withComposedModifiers.kt.after | 6 +- .../loopToCallChain/KT14191.kt.after | 4 +- .../loopToCallChain/KT14191.kt.after2 | 6 +- .../loopToCallChain/any/indexNeeded.kt.after | 4 +- .../loopToCallChain/any/indexNeeded.kt.after2 | 6 +- .../loopToCallChain/asSequenceOnly.kt.after2 | 6 +- .../loopToCallChain/count/long.kt.after | 4 +- .../loopToCallChain/count/long.kt.after2 | 6 +- .../count/variableUsedBefore.kt.after2 | 6 +- .../assign_MutableListRequired.kt.after | 4 +- .../assign_MutableListRequired.kt.after2 | 6 +- .../doNotSplitOutFilterNotNull.kt.after | 4 +- .../doNotSplitOutFilterNotNull.kt.after2 | 6 +- .../filter/filterIndexed.kt.after | 4 +- .../filter/filterIndexed.kt.after2 | 6 +- .../filter/filterIndexed2.kt.after | 4 +- .../filter/filterIndexed2.kt.after2 | 6 +- ...lterIndexedAndFlatMapWithContinue.kt.after | 8 +- ...terIndexedAndFlatMapWithContinue.kt.after2 | 10 +- .../filter/filterIndexed_merge1.kt.after | 4 +- .../filter/filterIndexed_merge1.kt.after2 | 6 +- .../filter/filterIndexed_merge2.kt.after | 4 +- .../filter/filterIndexed_merge2.kt.after2 | 6 +- .../filter/filterIndexed_merge3.kt.after | 4 +- .../filter/filterIndexed_merge3.kt.after2 | 6 +- .../filter/filterIndexed_merge4.kt.after | 4 +- .../filter/filterIndexed_merge4.kt.after2 | 6 +- .../filter/filterIndexed_twoIndices.kt.after | 4 +- .../filter/filterIndexed_twoIndices.kt.after2 | 6 +- .../filter/filterIsInstance.kt.after | 6 +- .../filter/filterIsInstance.kt.after2 | 8 +- .../filter/filterIsInstanceTo.kt.after2 | 4 +- .../filterIsInstance_ifContinue.kt.after | 6 +- .../filterIsInstance_ifContinue.kt.after2 | 8 +- .../filter/filterNotNull.kt.after | 6 +- .../filter/filterNotNull.kt.after2 | 8 +- .../filter/filterNotNull_ifContinue.kt.after | 6 +- .../filter/filterNotNull_ifContinue.kt.after2 | 8 +- .../filter/filterNot_ifContinue.kt.after | 6 +- .../filter/filterNot_ifContinue.kt.after2 | 8 +- .../filter/glueTogetherFilterNotNull.kt.after | 4 +- .../glueTogetherFilterNotNull.kt.after2 | 6 +- .../filter/mergeMultiple.kt.after | 6 +- .../filter/mergeMultiple.kt.after2 | 8 +- .../filter/splitOutFilterIsInstance.kt.after | 4 +- .../filter/splitOutFilterIsInstance.kt.after2 | 6 +- .../filter/splitOutFilterNotNull.kt.after | 6 +- .../filter/splitOutFilterNotNull.kt.after2 | 8 +- .../filter/splitOutFilterNotNull2.kt.after | 6 +- .../filter/splitOutFilterNotNull2.kt.after2 | 8 +- .../loopToCallChain/firstOrNull/let.kt.after | 4 +- .../loopToCallChain/firstOrNull/let2.kt.after | 4 +- .../firstOrNull/letOrNotNull.kt.after | 6 +- .../firstOrNull/returnExpression.kt.after | 4 +- .../returnExpressionOrNotNull.kt.after | 6 +- .../firstOrNull/returnNotNullIfNone.kt.after | 2 +- .../firstOrNull/safeDotExpression.kt.after | 4 +- .../loopToCallChain/flatMap/break.kt.after | 4 +- .../loopToCallChain/flatMap/break.kt.after2 | 6 +- .../loopToCallChain/flatMap/continue.kt.after | 4 +- .../flatMap/continue.kt.after2 | 6 +- .../flatMap/flatMapTo.kt.after2 | 4 +- .../flatMap/flatMapTo2.kt.after2 | 4 +- .../flatMap/flatMapTo3.kt.after2 | 4 +- .../flatMap/indexUsed.kt.after | 6 +- .../flatMap/indexUsed.kt.after2 | 8 +- .../loopToCallChain/flatMap/simple.kt.after | 4 +- .../loopToCallChain/flatMap/simple.kt.after2 | 6 +- .../loopToCallChain/forEach/KT14341.kt.after | 4 +- .../loopToCallChain/forEach/KT14341.kt.after2 | 6 +- .../loopToCallChain/forEach/indexed.kt.after | 4 +- .../loopToCallChain/forEach/indexed.kt.after2 | 6 +- .../forEach/notIndexed.kt.after | 4 +- .../forEach/notIndexed.kt.after2 | 6 +- .../loopToCallChain/forEach/simple.kt.after | 4 +- .../loopToCallChain/forEach/simple.kt.after2 | 6 +- .../indexPlusPlusInsideExpression.kt.after | 6 +- .../indexPlusPlusInsideExpression.kt.after2 | 8 +- ...xpression_indexUsedAfterIncrement.kt.after | 6 +- ...pression_indexUsedAfterIncrement.kt.after2 | 8 +- ...pression_indexUsedBeforeIncrement.kt.after | 8 +- ...ression_indexUsedBeforeIncrement.kt.after2 | 10 +- ...ression_indexUsedBeforeIncrement2.kt.after | 6 +- ...ession_indexUsedBeforeIncrement2.kt.after2 | 8 +- .../indexPlusPlusIsNotLastStatement.kt.after | 6 +- .../indexPlusPlusIsNotLastStatement.kt.after2 | 8 +- .../indexWithNestedLoop.kt.after | 6 +- .../indexWithNestedLoop.kt.after2 | 8 +- ...efixIndexPlusPlusInsideExpression.kt.after | 6 +- ...fixIndexPlusPlusInsideExpression.kt.after2 | 8 +- .../loopToCallChain/map/assignMap.kt.after | 4 +- .../loopToCallChain/map/assignMap.kt.after2 | 8 +- .../loopToCallChain/map/assignMap2.kt.after | 4 +- .../loopToCallChain/map/assignMap2.kt.after2 | 8 +- .../loopToCallChain/map/map.kt.after | 4 +- .../loopToCallChain/map/map.kt.after2 | 6 +- .../map/mapAndFilterIndexed.kt.after | 6 +- .../map/mapAndFilterIndexed.kt.after2 | 8 +- .../loopToCallChain/map/mapIndexed.kt.after | 4 +- .../loopToCallChain/map/mapIndexed.kt.after2 | 6 +- .../map/mapIndexedNotNull.kt.after | 4 +- .../map/mapIndexedNotNull.kt.after2 | 6 +- .../mapIndexedNotNull_elvisContinue.kt.after | 4 +- .../mapIndexedNotNull_elvisContinue.kt.after2 | 6 +- .../map/mapIndexed_afterFilter.kt.after | 6 +- .../map/mapIndexed_afterFilter.kt.after2 | 8 +- .../map/mapIndexed_twice.kt.after | 6 +- .../map/mapIndexed_twice.kt.after2 | 8 +- .../loopToCallChain/map/mapNotNull.kt.after | 4 +- .../loopToCallChain/map/mapNotNull.kt.after2 | 6 +- .../map/mapNotNull_elvisContinue.kt.after | 4 +- .../map/mapNotNull_elvisContinue.kt.after2 | 6 +- ...apNotNull_nestedLoopElvisContinue.kt.after | 6 +- ...pNotNull_nestedLoopElvisContinue.kt.after2 | 8 +- .../loopToCallChain/map/mapTo.kt.after | 4 +- .../loopToCallChain/map/mapTo.kt.after2 | 6 +- .../loopToCallChain/map/mapTo3.kt.after | 4 +- .../loopToCallChain/map/mapTo3.kt.after2 | 6 +- .../loopToCallChain/map/mapTo4.kt.after | 4 +- .../loopToCallChain/map/mapTo4.kt.after2 | 6 +- .../map/mapTo_inputVarNotUsed.kt.after | 4 +- .../map/mapTo_inputVarNotUsed.kt.after2 | 6 +- .../loopToCallChain/map/mapVar.kt.after | 4 +- .../loopToCallChain/map/mapVar.kt.after2 | 6 +- .../loopToCallChain/maxMin/KT14210.kt.after | 6 +- .../loopToCallChain/maxMin/KT14210.kt.after2 | 8 +- .../loopToCallChain/maxMin/max1.kt.after | 6 +- .../loopToCallChain/maxMin/max1.kt.after2 | 8 +- .../loopToCallChain/maxMin/max2.kt.after | 6 +- .../loopToCallChain/maxMin/max2.kt.after2 | 8 +- .../loopToCallChain/maxMin/max3.kt.after | 6 +- .../loopToCallChain/maxMin/max3.kt.after2 | 8 +- .../loopToCallChain/maxMin/max4.kt.after | 2 +- .../loopToCallChain/maxMin/max5.kt.after | 6 +- .../loopToCallChain/maxMin/max5.kt.after2 | 8 +- .../loopToCallChain/maxMin/max6.kt.after | 6 +- .../loopToCallChain/maxMin/max6.kt.after2 | 8 +- .../loopToCallChain/maxMin/max7.kt.after | 6 +- .../loopToCallChain/maxMin/max7.kt.after2 | 8 +- .../loopToCallChain/maxMin/min1.kt.after | 6 +- .../loopToCallChain/maxMin/min1.kt.after2 | 8 +- .../loopToCallChain/maxMin/min2.kt.after | 6 +- .../loopToCallChain/maxMin/min2.kt.after2 | 8 +- .../loopToCallChain/maxMin/min3.kt.after | 6 +- .../loopToCallChain/maxMin/min3.kt.after2 | 8 +- .../loopToCallChain/maxMin/min4.kt.after | 6 +- .../loopToCallChain/maxMin/min4.kt.after2 | 8 +- .../loopToCallChain/maxMin/min5.kt.after | 6 +- .../loopToCallChain/maxMin/min5.kt.after2 | 8 +- .../smartCasts/errorOutsideLoop.kt.after | 6 +- .../smartCasts/errorOutsideLoop.kt.after2 | 8 +- .../smartCasts/smartCastNotBroken.kt.after | 8 +- .../smartCasts/smartCastNotBroken.kt.after2 | 10 +- .../smartCasts/smartCastNotBroken2.kt.after | 6 +- .../smartCasts/smartCastNotBroken2.kt.after2 | 8 +- .../smartCasts/smartCastNotBroken3.kt.after | 6 +- .../smartCasts/smartCastNotBroken3.kt.after2 | 8 +- .../smartCasts/smartCastNotBroken4.kt.after | 6 +- .../smartCasts/smartCastNotBroken4.kt.after2 | 8 +- .../smartCasts/smartCastNotBroken5.kt.after | 6 +- .../smartCasts/smartCastNotBroken5.kt.after2 | 8 +- .../smartCasts/smartCastNotRequired.kt.after | 8 +- .../smartCasts/smartCastNotRequired.kt.after2 | 10 +- .../smartCasts/smartCastRequired2.kt.after | 8 +- .../smartCasts/smartCastRequired2.kt.after2 | 10 +- .../loopToCallChain/sum/indexUsed.kt.after | 4 +- .../loopToCallChain/sum/indexUsed.kt.after2 | 6 +- .../loopToCallChain/sum/indexUsed2.kt.after | 4 +- .../loopToCallChain/sum/indexUsed2.kt.after2 | 6 +- .../loopToCallChain/sum/smartCast.kt.after | 4 +- .../loopToCallChain/sum/smartCast.kt.after2 | 6 +- .../sum/smartCastNotNull.kt.after | 4 +- .../sum/smartCastNotNull.kt.after2 | 6 +- .../sum/sumByIntsIntoLong.kt.after | 4 +- .../sum/sumByIntsIntoLong.kt.after2 | 6 +- .../takeWhile/nestedLoop.kt.after | 4 +- .../takeWhile/nestedLoop.kt.after2 | 6 +- .../takeWhile/simple.kt.after2 | 4 +- .../resultCollectionUsedInsideLoop.kt.after | 4 +- .../resultCollectionUsedInsideLoop.kt.after2 | 6 +- .../toCollection/toSetWithMap.kt.after | 4 +- .../toCollection/toSetWithMap.kt.after2 | 6 +- .../twoInitializationsBeforeLoop.kt.after | 4 +- .../twoInitializationsBeforeLoop.kt.after2 | 8 +- .../annotationTarget.kt.after | 7 +- .../functionReference.kt.after | 6 +- .../withoutMatchingParameter.kt.after | 4 +- .../operatorToFunction/keepComments.kt.after | 6 +- .../common/myExtension.kt.after | 4 +- .../addAnnotationTarget/withJava.after.kt | 11 +- .../commentAhead.kt.after | 8 +- .../dataClassPropertyByNamedArgument.kt.after | 8 +- .../quickfix/createLabel/breakInLoop.kt.after | 2 +- .../createLabel/breakInOuterLoop.kt.after | 2 +- .../createLabel/continueInLoop.kt.after | 2 +- .../keepComments/addArguments.kt.after | 10 +- .../commentBeforeArgument.kt.after | 5 +- .../keepComments/multipleArguments.kt.after | 5 +- .../keepLineBreaks/addArgument.kt.after | 7 +- .../lineBreakAfterReceiverRuntime.kt.after | 8 +- .../keepLineBreaks/simple.kt.after | 8 +- ...optionalParameterAndLambdaComplex.kt.after | 4 +- .../quickfix/foldTryCatch/conditional.kt | 3 +- .../quickfix/foldTryCatch/emptyFinally.kt | 6 +- .../foldTryCatch/multipleExceptions.kt | 9 +- idea/testData/quickfix/foldTryCatch/shadow.kt | 3 +- idea/testData/quickfix/foldTryCatch/simple.kt | 3 +- .../replaceWithDotCall/comment.kt.after | 4 +- .../replaceWithDotCall/lineBreak.kt.after | 2 +- .../replaceWithSafeCall/comment.kt.after | 4 +- .../replaceWithSafeCall/lineBreak.kt.after | 2 +- .../comment.kt.after | 8 +- .../lineBreak.kt.after | 6 +- .../someParametersAlreadyExist.kt.after | 3 +- .../typeOfAnnotationMember/boolean.kt.after | 4 +- .../typeOfAnnotationMember/byte.kt.after | 4 +- .../typeOfAnnotationMember/char.kt.after | 4 +- .../typeOfAnnotationMember/float.kt.after | 4 +- .../typeOfAnnotationMember/int.kt.after | 4 +- .../typeOfAnnotationMember/long.kt.after | 4 +- .../typeOfAnnotationMember/short.kt.after | 4 +- ...vertParameterToReceiverAddParentsAfter.kt} | 0 ...ertParameterToReceiverAddParentsBefore.kt} | 0 .../tooManyOutputValuesAsList.kt.after | 8 +- .../controlFlow/outputValues/triple.kt.after | 7 +- .../duplicates/branchingMatch1.kt.after | 2 +- .../localExtensionFunChainedCalls.kt.after | 7 +- ...ParametersAndConstraintsCombined1.kt.after | 7 +- .../addImportOnParameterPullUp.kt.after | 2 +- .../FunctionalParameterPassed.kt | 2 +- .../FunctionalParameterPassed.kt.after | 2 +- ...neAnonymousClassWithPrivateMethod.kt.after | 14 +- .../returnAtEnd/DefaultParameter.kt.after | 3 +- .../lambdaParamMultiline.kt.after | 4 +- .../multilineBinaryExpression.kt.after | 10 +- ...ilineBinaryExpressionWithComments.kt.after | 10 +- .../multilineNestedBinaryExpression1.kt.after | 10 +- .../multilineNestedBinaryExpression2.kt.after | 10 +- .../rawTemplateWithSubstring.kt.after | 8 +- .../multilineBinaryExpression.kt.after | 6 +- ...ilineBinaryExpressionWithComments.kt.after | 6 +- .../multilineNestedBinaryExpression1.kt.after | 6 +- .../multilineNestedBinaryExpression2.kt.after | 6 +- .../rawTemplateWithSubstring.kt.after | 6 +- .../pullUp/k2j/constructorParameterToClass.kt | 10 +- .../k2j/constructorParameterToClass.kt.after | 6 +- .../k2k/constructorParametersToInterface.kt | 10 +- .../constructorParametersToInterface.kt.after | 10 +- ...orParametersToSuperClassAndMakeAbstract.kt | 10 +- ...metersToSuperClassAndMakeAbstract.kt.after | 10 +- .../k2k/fromClassToClassWithGenerics.kt.after | 3 +- .../codeInsight/smartEnter/SmartEnterTest.kt | 263 ++++++------------ .../quickfix/AbstractQuickFixMultiFileTest.kt | 222 +++++++-------- .../AbstractQuickFixMultiModuleTest.kt | 23 +- .../idea/quickfix/AbstractQuickFixTest.kt | 49 ++-- .../KotlinChangeSignatureTest.kt | 40 ++- .../idea/stubs/AbstractMultiModuleTest.kt | 13 +- .../annotations/annotationDefault.kt | 12 +- ...nnotationFromConstructorParamToProperty.kt | 6 +- .../annotations/annotationInterface1.kt | 6 +- .../bitOperationPriorityComments.kt | 3 +- .../classExpression/complexExample.kt | 3 +- .../comments/commentInsideCall.kt | 8 +- .../comments/commentsForConstructors.kt | 2 +- .../comments/fieldsInitializedFromParams.kt | 14 +- .../constructors/customerBuilder.kt | 6 +- .../fieldsInitializedFromParamsAnnotations.kt | 6 +- .../lineBreaksBetweenParameters.kt | 22 +- .../detectProperties/Comments.kt | 4 +- .../DataClassWithAnnotations.kt | 10 +- .../deprecatedDocTagWithMultiLineMessage.kt | 14 +- .../enum/runnableImplementation.kt | 6 +- .../fileOrElement/equals/EqOperator.kt | 20 +- .../fileOrElement/formatting/chainedCall.kt | 4 +- .../formatting/lineBreaksBetweenArguments.kt | 7 +- .../fileOrElement/formatting/parameterList.kt | 4 +- .../function/lineBreaksBetweenParameters.kt | 15 +- .../literalExpression/exponentDouble.kt | 33 ++- .../literalExpression/exponentFloat.kt | 31 ++- .../methodCallExpression/stringMethods.kt | 18 +- .../mutableCollections/FunctionParameters.kt | 10 +- .../mutableCollections/Overrides.kt | 5 +- .../newClassExpression/lineBreaks.kt | 8 +- .../ConversionInCorrectContext.expected.kt | 3 +- .../SeveralMethodsSample.expected.kt | 17 +- .../ImportResolve.expected.kt | 6 +- .../mutability/collectionMutableCalls.kt | 10 +- .../mutability/listIteratorMutableCalls.kt | 6 +- .../inference/mutability/listMutableCalls.kt | 16 +- .../inference/mutability/mapMutableCalls.kt | 8 +- .../inference/mutability/setMutableCalls.kt | 10 +- .../annotations/annotationArrayArgument.kt | 6 +- .../newJ2k/annotations/annotationDefault.kt | 13 +- .../annotations/annotationInterface1.kt | 6 +- .../newJ2k/annotations/annotationUsages.kt | 4 +- nj2k/testData/newJ2k/annotations/kt-31726.kt | 3 +- .../bitOperationPriorityComments.kt | 3 +- .../newJ2k/classExpression/complexExample.kt | 3 +- .../newJ2k/comments/commentInsideCall.kt | 4 +- .../comments/commentsForConstructors.kt | 2 +- .../comments/fieldsInitializedFromParams.kt | 13 +- .../newJ2k/constructors/customerBuilder.kt | 6 +- .../fieldsInitializedFromParams8.kt | 4 +- .../fieldsInitializedFromParamsAnnotations.kt | 6 +- .../lineBreaksBetweenParameters.kt | 22 +- .../newJ2k/detectProperties/Comments.kt | 7 +- .../DataClassWithAnnotations.kt | 8 +- .../commentInInitStatement.kt | 2 +- .../deprecatedDocTagWithMultiLineMessage.kt | 6 +- .../newJ2k/enum/runnableImplementation.kt | 6 +- nj2k/testData/newJ2k/equals/EqOperator.kt | 20 +- .../testData/newJ2k/formatting/chainedCall.kt | 4 +- .../formatting/lineBreaksBetweenArguments.kt | 7 +- .../newJ2k/formatting/parameterList.kt | 4 +- .../function/lineBreaksBetweenParameters.kt | 15 +- nj2k/testData/newJ2k/issues/kt-19569.kt | 6 +- nj2k/testData/newJ2k/issues/kt-21189.kt | 14 +- .../newJ2k/javaStreamsApi/createStream.kt | 24 +- .../newJ2k/javaStreamsApi/formatting.kt | 13 +- .../newJ2k/javaStreamsApi/kt-21467.kt | 24 +- .../newJ2k/javaStreamsApi/streamOperations.kt | 18 +- .../literalExpression/exponentDouble.kt | 10 +- .../newJ2k/literalExpression/exponentFloat.kt | 12 +- .../methodCallExpression/stringMethods.kt | 20 +- .../mutableCollections/FunctionParameters.kt | 10 +- .../newJ2k/mutableCollections/Overrides.kt | 5 +- .../newJ2k/newClassExpression/lineBreaks.kt | 8 +- .../newJ2k/overloads/ConflictParameterName.kt | 10 +- .../types/capturedTypeInStreamsLambda.kt | 4 +- 406 files changed, 1785 insertions(+), 1525 deletions(-) rename idea/testData/refactoring/changeSignature/{ConvertParameterToReceiverAddParensAfter.kt => ConvertParameterToReceiverAddParentsAfter.kt} (100%) rename idea/testData/refactoring/changeSignature/{ConvertParameterToReceiverAddParensBefore.kt => ConvertParameterToReceiverAddParentsBefore.kt} (100%) diff --git a/idea/idea-completion/testData/handlers/basic/override/ValInConstructorParameter2.kt b/idea/idea-completion/testData/handlers/basic/override/ValInConstructorParameter2.kt index 16d753b6880..7f176275f90 100644 --- a/idea/idea-completion/testData/handlers/basic/override/ValInConstructorParameter2.kt +++ b/idea/idea-completion/testData/handlers/basic/override/ValInConstructorParameter2.kt @@ -4,8 +4,8 @@ interface I { class CCCC( over - private val v1: Int, - private val v2: Int + private val v1: Int, + private val v2: Int ) : I // ELEMENT_TEXT: "override val p: Int" diff --git a/idea/idea-completion/testData/handlers/basic/override/ValInConstructorParameter2.kt.after b/idea/idea-completion/testData/handlers/basic/override/ValInConstructorParameter2.kt.after index 3314486fb02..7318800fea0 100644 --- a/idea/idea-completion/testData/handlers/basic/override/ValInConstructorParameter2.kt.after +++ b/idea/idea-completion/testData/handlers/basic/override/ValInConstructorParameter2.kt.after @@ -3,9 +3,9 @@ interface I { } class CCCC( - override val p: Int - private val v1: Int, - private val v2: Int + override val p: Int + private val v1: Int, + private val v2: Int ) : I // ELEMENT_TEXT: "override val p: Int" diff --git a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/SmartEnterCompletionTest.kt b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/SmartEnterCompletionTest.kt index cf3c9d022a9..ee3cd88a622 100644 --- a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/SmartEnterCompletionTest.kt +++ b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/SmartEnterCompletionTest.kt @@ -115,8 +115,10 @@ class SmartEnterCompletionTest : KotlinLightCodeInsightFixtureTestCase() { fun foo(p:Int) {} fun test() { - foo(1 + - 2) + foo( + 1 + + 2 + ) } """ ) diff --git a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt index 5650eee0c3b..e1e68214440 100644 --- a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt +++ b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt @@ -1,5 +1,5 @@ /* - * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2000-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -40,6 +40,7 @@ import org.jetbrains.kotlin.idea.KotlinFileType import org.jetbrains.kotlin.idea.compiler.configuration.KotlinCommonCompilerArgumentsHolder import org.jetbrains.kotlin.idea.compiler.configuration.KotlinCompilerSettings import org.jetbrains.kotlin.idea.facet.* +import org.jetbrains.kotlin.idea.formatter.KotlinStyleGuideCodeStyle import org.jetbrains.kotlin.idea.inspections.UnusedSymbolInspection import org.jetbrains.kotlin.idea.test.CompilerTestDirectives.COMPILER_ARGUMENTS_DIRECTIVE import org.jetbrains.kotlin.idea.test.CompilerTestDirectives.JVM_TARGET_DIRECTIVE @@ -76,6 +77,8 @@ abstract class KotlinLightCodeInsightFixtureTestCase : KotlinLightCodeInsightFix override fun setUp() { super.setUp() + + enableKotlinOfficialCodeStyle(project) // We do it here to avoid possible initialization problems // UnusedSymbolInspection() calls IDEA UnusedDeclarationInspection() in static initializer, // which in turn registers some extensions provoking "modifications aren't allowed during highlighting" @@ -101,7 +104,7 @@ abstract class KotlinLightCodeInsightFixtureTestCase : KotlinLightCodeInsightFix override fun tearDown() { LoggedErrorProcessor.restoreDefaultProcessor() - + disableKotlinOfficialCodeStyle(project) super.tearDown() if (exceptions.isNotEmpty()) { @@ -312,6 +315,14 @@ fun configureCodeStyleAndRun( } } +fun enableKotlinOfficialCodeStyle(project: Project) { + KotlinStyleGuideCodeStyle.apply(CodeStyle.getSettings(project)) +} + +fun disableKotlinOfficialCodeStyle(project: Project) { + CodeStyle.getSettings(project) +} + private fun rollbackCompilerOptions(project: Project, module: Module, removeFacet: Boolean) { KotlinCompilerSettings.getInstance(project).update { this.additionalArguments = DEFAULT_ADDITIONAL_ARGUMENTS } KotlinCommonCompilerArgumentsHolder.getInstance(project).update { this.languageVersion = LanguageVersion.LATEST_STABLE.versionString } diff --git a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightFixtureTestCase.kt b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightFixtureTestCase.kt index cdecd53df5b..d6ec63e14ed 100644 --- a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightFixtureTestCase.kt +++ b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightFixtureTestCase.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -17,12 +17,14 @@ import kotlin.reflect.full.findAnnotation abstract class KotlinLightPlatformCodeInsightFixtureTestCase : LightPlatformCodeInsightFixtureTestCase() { override fun setUp() { super.setUp() + enableKotlinOfficialCodeStyle(project) (StartupManager.getInstance(project) as StartupManagerImpl).runPostStartupActivities() VfsRootAccess.allowRootAccess(KotlinTestUtils.getHomeDirectory()) invalidateLibraryCache(project) } override fun tearDown() { + disableKotlinOfficialCodeStyle(project) VfsRootAccess.disallowRootAccess(KotlinTestUtils.getHomeDirectory()) super.tearDown() diff --git a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt index 6b077820b3c..e547ff54d2a 100644 --- a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt +++ b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt @@ -13,4 +13,14 @@ import com.intellij.testFramework.LightPlatformCodeInsightTestCase abstract class KotlinLightPlatformCodeInsightTestCase : LightPlatformCodeInsightTestCase() { protected inline val project_: Project get() = project protected inline val editor_: Editor get() = editor + + override fun setUp() { + super.setUp() + enableKotlinOfficialCodeStyle(project_) + } + + override fun tearDown() { + disableKotlinOfficialCodeStyle(project_) + super.tearDown() + } } \ No newline at end of file diff --git a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt.191 b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt.191 index cf90d2ecc31..1afa16c10dd 100644 --- a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt.191 +++ b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt.191 @@ -15,4 +15,13 @@ abstract class KotlinLightPlatformCodeInsightTestCase : LightPlatformCodeInsight protected inline val project_: Project get() = LightPlatformTestCase.getProject() protected inline val editor_: Editor get() = LightPlatformCodeInsightTestCase.getEditor() + override fun setUp() { + super.setUp() + enableKotlinOfficialCodeStyle(project_) + } + + override fun tearDown() { + disableKotlinOfficialCodeStyle(project_) + super.tearDown() + } } \ No newline at end of file diff --git a/idea/testData/copyPaste/conversion/ConversionInCorrectContext.expected.kt b/idea/testData/copyPaste/conversion/ConversionInCorrectContext.expected.kt index d7026fe8098..faa5b84cab2 100644 --- a/idea/testData/copyPaste/conversion/ConversionInCorrectContext.expected.kt +++ b/idea/testData/copyPaste/conversion/ConversionInCorrectContext.expected.kt @@ -1,3 +1,4 @@ fun foo(p: Dependency): Double { - return p.getInt().toDouble() // explicit conversion to Double must be added on conversion (if type Dependency) is correctly resolved + return p.getInt() + .toDouble() // explicit conversion to Double must be added on conversion (if type Dependency) is correctly resolved } diff --git a/idea/testData/copyPaste/conversion/SeveralMethodsSample.expected.kt b/idea/testData/copyPaste/conversion/SeveralMethodsSample.expected.kt index c49652ce8d6..0763b6d8b4d 100644 --- a/idea/testData/copyPaste/conversion/SeveralMethodsSample.expected.kt +++ b/idea/testData/copyPaste/conversion/SeveralMethodsSample.expected.kt @@ -5,16 +5,17 @@ class A { var element = element element = JetPsiUtil.ascendIfPropertyAccessor(element) if (element is JetNamedFunction || element is JetProperty) { - val bindingContext = AnalyzerFacadeWithCache.analyzeFileWithCache(element.getContainingJetFile()).getBindingContext() + val bindingContext = + AnalyzerFacadeWithCache.analyzeFileWithCache(element.getContainingJetFile()).getBindingContext() val declarationDescriptor = bindingContext.get(BindingContext.DECLARATION_TO_DESCRIPTOR, element) if (declarationDescriptor is CallableMemberDescriptor) { val containingDescriptor = declarationDescriptor.getContainingDeclaration() if (containingDescriptor is ClassDescriptor) { return JetBundle.message( - "override.declaration.x.in.y", - DescriptorRenderer.COMPACT.render(declarationDescriptor), - IdeDescriptorRenderers.SOURCE_CODE_SHORT_NAMES_NO_ANNOTATIONS.render(containingDescriptor) + "override.declaration.x.in.y", + DescriptorRenderer.COMPACT.render(declarationDescriptor), + IdeDescriptorRenderers.SOURCE_CODE_SHORT_NAMES_NO_ANNOTATIONS.render(containingDescriptor) ) } } diff --git a/idea/testData/copyPaste/plainTextConversion/ImportResolve.expected.kt b/idea/testData/copyPaste/plainTextConversion/ImportResolve.expected.kt index d5793ea42fb..902cc60c018 100644 --- a/idea/testData/copyPaste/plainTextConversion/ImportResolve.expected.kt +++ b/idea/testData/copyPaste/plainTextConversion/ImportResolve.expected.kt @@ -20,8 +20,10 @@ class Target { } - var ambiguousKotlin: IAmbiguousKotlin = AmbiguousKotlin() // Should not add import in case of 2 declarations in Kotlin - var ambiguous: IAmbiguous = Ambiguous() // Should not add import in case of ambiguous declarations in Kotlin and in Java + var ambiguousKotlin: IAmbiguousKotlin = + AmbiguousKotlin() // Should not add import in case of 2 declarations in Kotlin + var ambiguous: IAmbiguous = + Ambiguous() // Should not add import in case of ambiguous declarations in Kotlin and in Java var ambiguousJava: IAmbiguousJava = AmbiguousJava() // Should not add import in case of 2 declarations in Java fun workWithStatics() { diff --git a/idea/testData/indentationOnNewline/AssignmentAfterEq.after.inv.kt b/idea/testData/indentationOnNewline/AssignmentAfterEq.after.inv.kt index a1f26e1903f..ccd54ec83d5 100644 --- a/idea/testData/indentationOnNewline/AssignmentAfterEq.after.inv.kt +++ b/idea/testData/indentationOnNewline/AssignmentAfterEq.after.inv.kt @@ -1,7 +1,7 @@ fun test() { var a = 1 a = - + } // SET_TRUE: ALIGN_MULTILINE_BINARY_OPERATION \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/AssignmentAfterEq.after.kt b/idea/testData/indentationOnNewline/AssignmentAfterEq.after.kt index a1f26e1903f..ccd54ec83d5 100644 --- a/idea/testData/indentationOnNewline/AssignmentAfterEq.after.kt +++ b/idea/testData/indentationOnNewline/AssignmentAfterEq.after.kt @@ -1,7 +1,7 @@ fun test() { var a = 1 a = - + } // SET_TRUE: ALIGN_MULTILINE_BINARY_OPERATION \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameters.after.kt b/idea/testData/indentationOnNewline/EmptyParameters.after.kt index 9e46ff3a854..5d605899128 100644 --- a/idea/testData/indentationOnNewline/EmptyParameters.after.kt +++ b/idea/testData/indentationOnNewline/EmptyParameters.after.kt @@ -1,4 +1,4 @@ fun testParam( - + ) { } \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/FunctionWithInference.after.kt b/idea/testData/indentationOnNewline/FunctionWithInference.after.kt index cdd35d0107e..1c4df3e5491 100644 --- a/idea/testData/indentationOnNewline/FunctionWithInference.after.kt +++ b/idea/testData/indentationOnNewline/FunctionWithInference.after.kt @@ -1,2 +1,2 @@ fun test() = - \ No newline at end of file + \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/InDelegationListNotEmpty.after.inv.kt b/idea/testData/indentationOnNewline/InDelegationListNotEmpty.after.inv.kt index 9ec57d41928..6d6542203bd 100644 --- a/idea/testData/indentationOnNewline/InDelegationListNotEmpty.after.inv.kt +++ b/idea/testData/indentationOnNewline/InDelegationListNotEmpty.after.inv.kt @@ -5,4 +5,4 @@ interface A1 open class B1 class Simpleclass() : B1(), - A1 + A1 diff --git a/idea/testData/indentationOnNewline/InLambdaBeforeParams.after.kt b/idea/testData/indentationOnNewline/InLambdaBeforeParams.after.kt index 61f1cfec2d2..d64ed2ddcfa 100644 --- a/idea/testData/indentationOnNewline/InLambdaBeforeParams.after.kt +++ b/idea/testData/indentationOnNewline/InLambdaBeforeParams.after.kt @@ -1,3 +1,3 @@ val a: (String) -> String = { - some -> + some -> } \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/MultideclarationAfterEq.after.kt b/idea/testData/indentationOnNewline/MultideclarationAfterEq.after.kt index 8927aeace83..30c4063a9b1 100644 --- a/idea/testData/indentationOnNewline/MultideclarationAfterEq.after.kt +++ b/idea/testData/indentationOnNewline/MultideclarationAfterEq.after.kt @@ -1,4 +1,4 @@ fun test() { val (a, b) = - + } \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/PropertyWithInference.after.kt b/idea/testData/indentationOnNewline/PropertyWithInference.after.kt index c5d2284b0f1..713442135d2 100644 --- a/idea/testData/indentationOnNewline/PropertyWithInference.after.kt +++ b/idea/testData/indentationOnNewline/PropertyWithInference.after.kt @@ -1,2 +1,2 @@ val a = - \ No newline at end of file + \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/branched/ifThenToElvis/ifToElvisSwallowComments.kt.after b/idea/testData/inspectionsLocal/branched/ifThenToElvis/ifToElvisSwallowComments.kt.after index d0ab03404a6..86a90f25ab7 100644 --- a/idea/testData/inspectionsLocal/branched/ifThenToElvis/ifToElvisSwallowComments.kt.after +++ b/idea/testData/inspectionsLocal/branched/ifThenToElvis/ifToElvisSwallowComments.kt.after @@ -1,6 +1,6 @@ fun foo(arg: Any): Int { // 1 return arg as? Int -// 2 - ?: 10 + // 2 + ?: 10 } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/branched/ifThenToElvis/longLine.kt.after b/idea/testData/inspectionsLocal/branched/ifThenToElvis/longLine.kt.after index 9dc33085f49..4ac197573b8 100644 --- a/idea/testData/inspectionsLocal/branched/ifThenToElvis/longLine.kt.after +++ b/idea/testData/inspectionsLocal/branched/ifThenToElvis/longLine.kt.after @@ -6,5 +6,5 @@ val xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx fun main() { val c = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - ?: "abcdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdf" + ?: "abcdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdf" } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/allTransformations.kt.after b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/allTransformations.kt.after index c6e332b3f36..ee94afdd3a2 100644 --- a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/allTransformations.kt.after +++ b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/allTransformations.kt.after @@ -2,37 +2,37 @@ fun test(list: List): List>, IndexedValue>>> { return list - .asSequence() - .chunked(1) - .distinct() - .distinctBy { it } - .drop(1) - .dropWhile { true } - .filter { true } - .filterIndexed { index, list -> true } - .filterIsInstance() - .filterNot { true } - .filterNotNull() - .map { it } - .mapIndexed { index, i -> i } - .mapIndexedNotNull { index, i -> i } - .mapNotNull { it } - .minus(1) - .minusElement(1) - .onEach {} - .plus(1) - .plusElement(1) - .requireNoNulls() - .sorted() - .sortedBy { it } - .sortedByDescending { it } - .sortedDescending() - .sortedWith(Comparator { o1, o2 -> 0 }) - .take(1) - .takeWhile { true } - .windowed(1, 1, true) - .withIndex() - .zipWithNext() - .zipWithNext { a, b -> a } - .toList() + .asSequence() + .chunked(1) + .distinct() + .distinctBy { it } + .drop(1) + .dropWhile { true } + .filter { true } + .filterIndexed { index, list -> true } + .filterIsInstance() + .filterNot { true } + .filterNotNull() + .map { it } + .mapIndexed { index, i -> i } + .mapIndexedNotNull { index, i -> i } + .mapNotNull { it } + .minus(1) + .minusElement(1) + .onEach {} + .plus(1) + .plusElement(1) + .requireNoNulls() + .sorted() + .sortedBy { it } + .sortedByDescending { it } + .sortedDescending() + .sortedWith(Comparator { o1, o2 -> 0 }) + .take(1) + .takeWhile { true } + .windowed(1, 1, true) + .withIndex() + .zipWithNext() + .zipWithNext { a, b -> a } + .toList() } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/comment.kt b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/comment.kt index 6aaf9d981af..324677395be 100644 --- a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/comment.kt +++ b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/comment.kt @@ -2,7 +2,7 @@ fun test(list: List): Int { return list // comment1 - .filter { it > 1 } // comment2 - .map { it * 2 } // comment3 - .sum() // comment4 + .filter { it > 1 } // comment2 + .map { it * 2 } // comment3 + .sum() // comment4 } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/comment.kt.after b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/comment.kt.after index 28cdd42c077..b55c4eed135 100644 --- a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/comment.kt.after +++ b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/comment.kt.after @@ -2,8 +2,8 @@ fun test(list: List): Int { return list // comment1 - .asSequence() - .filter { it > 1 } // comment2 - .map { it * 2 } // comment3 - .sum() // comment4 + .asSequence() + .filter { it > 1 } // comment2 + .map { it * 2 } // comment3 + .sum() // comment4 } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/comment2.kt b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/comment2.kt index 26a49549cbe..08d7cb5069e 100644 --- a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/comment2.kt +++ b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/comment2.kt @@ -2,6 +2,6 @@ fun test(list: List): List { return list // comment1 - .filter { it > 1 } // comment2 - .map { it * 2 } // comment3 + .filter { it > 1 } // comment2 + .map { it * 2 } // comment3 } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/comment2.kt.after b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/comment2.kt.after index 039aa386f1c..4835fbca2d3 100644 --- a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/comment2.kt.after +++ b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/comment2.kt.after @@ -2,8 +2,8 @@ fun test(list: List): List { return list // comment1 - .asSequence() - .filter { it > 1 } // comment2 - .map { it * 2 } - .toList() // comment3 + .asSequence() + .filter { it > 1 } // comment2 + .map { it * 2 } + .toList() // comment3 } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/noTargetTermination.kt b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/noTargetTermination.kt index 7286d27456e..f09e56dcd9a 100644 --- a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/noTargetTermination.kt +++ b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/noTargetTermination.kt @@ -2,7 +2,7 @@ fun test(list: List>): List { return list - .filter { it.count() > 2 } - .map { it + it } - .flatMap { it + it } + .filter { it.count() > 2 } + .map { it + it } + .flatMap { it + it } } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/noTargetTermination.kt.after b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/noTargetTermination.kt.after index d722f941e11..18157f01cdf 100644 --- a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/noTargetTermination.kt.after +++ b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/noTargetTermination.kt.after @@ -2,9 +2,9 @@ fun test(list: List>): List { return list - .asSequence() - .filter { it.count() > 2 } - .map { it + it } - .toList() - .flatMap { it + it } + .asSequence() + .filter { it.count() > 2 } + .map { it + it } + .toList() + .flatMap { it + it } } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/noTargetTermination2.kt b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/noTargetTermination2.kt index db506dac515..4b050dd7594 100644 --- a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/noTargetTermination2.kt +++ b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/noTargetTermination2.kt @@ -2,9 +2,9 @@ fun test(): Int { return listOf(1, 2, 3) - .filter { it > 1 } - .map { it * 2 } - .let { - it.binarySearch(1) - } + .filter { it > 1 } + .map { it * 2 } + .let { + it.binarySearch(1) + } } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/noTargetTermination2.kt.after b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/noTargetTermination2.kt.after index 2634c754f10..ba65f16b147 100644 --- a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/noTargetTermination2.kt.after +++ b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/noTargetTermination2.kt.after @@ -2,11 +2,11 @@ fun test(): Int { return listOf(1, 2, 3) - .asSequence() - .filter { it > 1 } - .map { it * 2 } - .toList() - .let { - it.binarySearch(1) - } + .asSequence() + .filter { it > 1 } + .map { it * 2 } + .toList() + .let { + it.binarySearch(1) + } } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/nullable.kt.after b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/nullable.kt.after index 9110c8ba000..19dd6d75e97 100644 --- a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/nullable.kt.after +++ b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/nullable.kt.after @@ -2,8 +2,8 @@ fun test(list: List?): List? { return list - ?.asSequence() - ?.filter { it > 1 } - ?.map { it * 2 } - ?.toList() + ?.asSequence() + ?.filter { it > 1 } + ?.map { it * 2 } + ?.toList() } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/returnAtLabels.kt.after b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/returnAtLabels.kt.after index e1462640ce1..ba31f839d4c 100644 --- a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/returnAtLabels.kt.after +++ b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/returnAtLabels.kt.after @@ -2,11 +2,11 @@ fun test(list: List): List { return list - .asSequence() - .filter { it > 1 } - .mapNotNull { - if (it == 2) return@mapNotNull null - it * 2 - } - .toList() + .asSequence() + .filter { it > 1 } + .mapNotNull { + if (it == 2) return@mapNotNull null + it * 2 + } + .toList() } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple.kt.after b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple.kt.after index 711d46d8512..0ed1efcb7bf 100644 --- a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple.kt.after +++ b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple.kt.after @@ -3,5 +3,6 @@ // WITH_RUNTIME fun test(): List { - return listOf(1, 2, 3).asSequence().filter { it > 1 }.map { it * 2 }.map { it * 3 }.map { it * 4 }.map { it * 5 }.toList() + return listOf(1, 2, 3).asSequence().filter { it > 1 }.map { it * 2 }.map { it * 3 }.map { it * 4 }.map { it * 5 } + .toList() } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple2.kt b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple2.kt index 84447bb341a..ba85c6ba404 100644 --- a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple2.kt +++ b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple2.kt @@ -3,8 +3,8 @@ fun test(list: List): List { return list - .filter { it > 1 } - .map { it * 2 } - .map { it * 3 } - .map { it * 4 } + .filter { it > 1 } + .map { it * 2 } + .map { it * 3 } + .map { it * 4 } } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple2.kt.after b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple2.kt.after index a1c432607ba..659f0d2a66e 100644 --- a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple2.kt.after +++ b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple2.kt.after @@ -3,10 +3,10 @@ fun test(list: List): List { return list - .asSequence() - .filter { it > 1 } - .map { it * 2 } - .map { it * 3 } - .map { it * 4 } - .toList() + .asSequence() + .filter { it > 1 } + .map { it * 2 } + .map { it * 3 } + .map { it * 4 } + .toList() } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple3.kt b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple3.kt index 5c78c12f695..e86e9534fde 100644 --- a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple3.kt +++ b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple3.kt @@ -2,9 +2,9 @@ fun test(list: List): List { return list - .reversed() - .map { it + 1 } - .map { it + 1 } - .dropLast(1) - .takeLast(2) + .reversed() + .map { it + 1 } + .map { it + 1 } + .dropLast(1) + .takeLast(2) } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple3.kt.after b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple3.kt.after index 11be64e287a..19a98589b3e 100644 --- a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple3.kt.after +++ b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple3.kt.after @@ -2,11 +2,11 @@ fun test(list: List): List { return list - .reversed() - .asSequence() - .map { it + 1 } - .map { it + 1 } - .toList() - .dropLast(1) - .takeLast(2) -} + .reversed() + .asSequence() + .map { it + 1 } + .map { it + 1 } + .toList() + .dropLast(1) + .takeLast(2) +} \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple4.kt.after b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple4.kt.after index aca43ad97b0..e277bf19e64 100644 --- a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple4.kt.after +++ b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/simple4.kt.after @@ -2,10 +2,10 @@ fun test(foo: Foo): List { return foo.getList() - .asSequence() - .filter { it > 1 } - .map { it * 2 } - .toList() + .asSequence() + .filter { it > 1 } + .map { it * 2 } + .toList() } class Foo { diff --git a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/termination/filterIndexedTo.kt.after b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/termination/filterIndexedTo.kt.after index d19813ca1f7..edf4e583046 100644 --- a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/termination/filterIndexedTo.kt.after +++ b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/termination/filterIndexedTo.kt.after @@ -1,5 +1,6 @@ // WITH_RUNTIME fun test(list: List) { - val filterIndexedTo: MutableList = list.asSequence().filter { it > 1 }.filterIndexedTo(mutableListOf()) { index, it -> true } + val filterIndexedTo: MutableList = list.asSequence().filter { it > 1 } + .filterIndexedTo(mutableListOf()) { index, it -> true } } diff --git a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/termination/mapIndexedNotNullTo.kt.after b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/termination/mapIndexedNotNullTo.kt.after index ddc54c28a9c..34c98cd51bc 100644 --- a/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/termination/mapIndexedNotNullTo.kt.after +++ b/idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/termination/mapIndexedNotNullTo.kt.after @@ -1,5 +1,6 @@ // WITH_RUNTIME fun test(list: List) { - val mapIndexedNotNullTo: MutableList = list.asSequence().filter { it > 1 }.mapIndexedNotNullTo(mutableListOf()) { index, i -> i } + val mapIndexedNotNullTo: MutableList = list.asSequence().filter { it > 1 } + .mapIndexedNotNullTo(mutableListOf()) { index, i -> i } } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/simplifiableCallChain/joinToStringWithReferenceAndComment.kt.after b/idea/testData/inspectionsLocal/collections/simplifiableCallChain/joinToStringWithReferenceAndComment.kt.after index c0127ebc9f3..e8959b89689 100644 --- a/idea/testData/inspectionsLocal/collections/simplifiableCallChain/joinToStringWithReferenceAndComment.kt.after +++ b/idea/testData/inspectionsLocal/collections/simplifiableCallChain/joinToStringWithReferenceAndComment.kt.after @@ -1,12 +1,12 @@ // WITH_RUNTIME val x = listOf(1, 2, 3).joinToString( - // comment2 - prefix = "= ", - // comment3 - separator = " + " - // comment4 - , - // comment1 - transform = Int::toString + // comment2 + prefix = "= ", + // comment3 + separator = " + " + // comment4 + , + // comment1 + transform = Int::toString ) \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/simplifiableCallChain/joinToWithComment.kt.after b/idea/testData/inspectionsLocal/collections/simplifiableCallChain/joinToWithComment.kt.after index 9867ff5243c..3038b4d120f 100644 --- a/idea/testData/inspectionsLocal/collections/simplifiableCallChain/joinToWithComment.kt.after +++ b/idea/testData/inspectionsLocal/collections/simplifiableCallChain/joinToWithComment.kt.after @@ -2,11 +2,11 @@ val sb = StringBuilder() val x = listOf(1, 2, 3).joinTo( - // comment1 - buffer = sb, - // comment2 - prefix = "= ", - // comment3 - separator = " + " - // comment4 + // comment1 + buffer = sb, + // comment2 + prefix = "= ", + // comment3 + separator = " + " + // comment4 ) { "$it*$it" } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/simplifiableCallChain/listOfNotNullWithComment.kt.after b/idea/testData/inspectionsLocal/collections/simplifiableCallChain/listOfNotNullWithComment.kt.after index 07514a76345..866ad50d53b 100644 --- a/idea/testData/inspectionsLocal/collections/simplifiableCallChain/listOfNotNullWithComment.kt.after +++ b/idea/testData/inspectionsLocal/collections/simplifiableCallChain/listOfNotNullWithComment.kt.after @@ -2,7 +2,7 @@ fun test() { listOfNotNull( - true, // comment1 - null // comment2 + true, // comment1 + null // comment2 ).first() } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/simplifiableCallChain/saveComment.kt.after b/idea/testData/inspectionsLocal/collections/simplifiableCallChain/saveComment.kt.after index 5639d96715d..276b71ece23 100644 --- a/idea/testData/inspectionsLocal/collections/simplifiableCallChain/saveComment.kt.after +++ b/idea/testData/inspectionsLocal/collections/simplifiableCallChain/saveComment.kt.after @@ -1,3 +1,3 @@ // WITH_RUNTIME val v1 = // Some Comment - listOf(1, 2, 3, 11, 33, 25, 100).any { it % 2 == 0 } // Some Additional Comment \ No newline at end of file + listOf(1, 2, 3, 11, 33, 25, 100).any { it % 2 == 0 } // Some Additional Comment \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/collections/simplifiableCallChain/saveComment2.kt.after b/idea/testData/inspectionsLocal/collections/simplifiableCallChain/saveComment2.kt.after index 675e9a00c77..7c88f2992af 100644 --- a/idea/testData/inspectionsLocal/collections/simplifiableCallChain/saveComment2.kt.after +++ b/idea/testData/inspectionsLocal/collections/simplifiableCallChain/saveComment2.kt.after @@ -1,3 +1,3 @@ // WITH_RUNTIME val v1 = // Some Comment - listOf(1, 2, 3, 11, 33, 25, 100).any { it % 2 == 0 } \ No newline at end of file + listOf(1, 2, 3, 11, 33, 25, 100).any { it % 2 == 0 } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/foldInitializerAndIfToElvis/CommentInBlock.kt.after b/idea/testData/inspectionsLocal/foldInitializerAndIfToElvis/CommentInBlock.kt.after index 9633f1b8a91..4adb1284548 100644 --- a/idea/testData/inspectionsLocal/foldInitializerAndIfToElvis/CommentInBlock.kt.after +++ b/idea/testData/inspectionsLocal/foldInitializerAndIfToElvis/CommentInBlock.kt.after @@ -1,6 +1,6 @@ fun foo(p: List): Int { val v = p[0] - ?: // return -1 if null - return -1 + ?: // return -1 if null + return -1 return v.length } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/foldInitializerAndIfToElvis/Comments2.kt.after b/idea/testData/inspectionsLocal/foldInitializerAndIfToElvis/Comments2.kt.after index 85bc36dd462..984a8f8b4e4 100644 --- a/idea/testData/inspectionsLocal/foldInitializerAndIfToElvis/Comments2.kt.after +++ b/idea/testData/inspectionsLocal/foldInitializerAndIfToElvis/Comments2.kt.after @@ -1,8 +1,8 @@ fun foo(p: List): Int { val v = p[0] - ?: // v is null - // we should do something with it - return -1 // let's return -1 + ?: // v is null + // we should do something with it + return -1 // let's return -1 // end of if return v.length } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/foldInitializerAndIfToElvis/LongName.kt.after b/idea/testData/inspectionsLocal/foldInitializerAndIfToElvis/LongName.kt.after index 96f9bf04d70..93c744ec5df 100644 --- a/idea/testData/inspectionsLocal/foldInitializerAndIfToElvis/LongName.kt.after +++ b/idea/testData/inspectionsLocal/foldInitializerAndIfToElvis/LongName.kt.after @@ -1,6 +1,6 @@ fun foo(): Any { val yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy = 7 val xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx = 24 - ?: return yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy + ?: return yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy return 42 } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/migrateDiagnosticSuppression/multiple.kt b/idea/testData/inspectionsLocal/migrateDiagnosticSuppression/multiple.kt index 04783a4535e..07069ad43aa 100644 --- a/idea/testData/inspectionsLocal/migrateDiagnosticSuppression/multiple.kt +++ b/idea/testData/inspectionsLocal/migrateDiagnosticSuppression/multiple.kt @@ -1,6 +1,6 @@ @Suppress( - "HEADER_CLASS_CONSTRUCTOR_DELEGATION_CALL", - "HEADER_CLASS_CONSTRUCTOR_PROPERTY_PARAMETER", - "HEADER_ENUM_CONSTRUCTOR" + "HEADER_CLASS_CONSTRUCTOR_DELEGATION_CALL", + "HEADER_CLASS_CONSTRUCTOR_PROPERTY_PARAMETER", + "HEADER_ENUM_CONSTRUCTOR" ) class Dummy \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/migrateDiagnosticSuppression/multiple.kt.after b/idea/testData/inspectionsLocal/migrateDiagnosticSuppression/multiple.kt.after index 03acd40338f..229fa14d2cf 100644 --- a/idea/testData/inspectionsLocal/migrateDiagnosticSuppression/multiple.kt.after +++ b/idea/testData/inspectionsLocal/migrateDiagnosticSuppression/multiple.kt.after @@ -1,6 +1,6 @@ @Suppress( - "HEADER_CLASS_CONSTRUCTOR_DELEGATION_CALL", - "EXPECTED_CLASS_CONSTRUCTOR_PROPERTY_PARAMETER", - "HEADER_ENUM_CONSTRUCTOR" + "HEADER_CLASS_CONSTRUCTOR_DELEGATION_CALL", + "EXPECTED_CLASS_CONSTRUCTOR_PROPERTY_PARAMETER", + "HEADER_ENUM_CONSTRUCTOR" ) class Dummy \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/trailingComma/addComma.kt.after b/idea/testData/inspectionsLocal/trailingComma/addComma.kt.after index 88c61d70292..aa06716be4b 100644 --- a/idea/testData/inspectionsLocal/trailingComma/addComma.kt.after +++ b/idea/testData/inspectionsLocal/trailingComma/addComma.kt.after @@ -2,6 +2,6 @@ // FIX: Add trailing comma fun a( - i: Int, - b: Boolean, + i: Int, + b: Boolean, ) = Unit \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/trailingComma/addComma2.kt.after b/idea/testData/inspectionsLocal/trailingComma/addComma2.kt.after index 88c61d70292..aa06716be4b 100644 --- a/idea/testData/inspectionsLocal/trailingComma/addComma2.kt.after +++ b/idea/testData/inspectionsLocal/trailingComma/addComma2.kt.after @@ -2,6 +2,6 @@ // FIX: Add trailing comma fun a( - i: Int, - b: Boolean, + i: Int, + b: Boolean, ) = Unit \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/trailingComma/addComma5.kt.after b/idea/testData/inspectionsLocal/trailingComma/addComma5.kt.after index 88c61d70292..aa06716be4b 100644 --- a/idea/testData/inspectionsLocal/trailingComma/addComma5.kt.after +++ b/idea/testData/inspectionsLocal/trailingComma/addComma5.kt.after @@ -2,6 +2,6 @@ // FIX: Add trailing comma fun a( - i: Int, - b: Boolean, + i: Int, + b: Boolean, ) = Unit \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/trailingComma/addComma6.kt.after b/idea/testData/inspectionsLocal/trailingComma/addComma6.kt.after index bcf244fcdcc..4c50d3f90e7 100644 --- a/idea/testData/inspectionsLocal/trailingComma/addComma6.kt.after +++ b/idea/testData/inspectionsLocal/trailingComma/addComma6.kt.after @@ -2,9 +2,9 @@ // FIX: Add trailing comma val x = { - x: String, - y - : String, + x: String, + y + : String, -> val a = 2 } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/trailingComma/changeCommaPosition.kt.after b/idea/testData/inspectionsLocal/trailingComma/changeCommaPosition.kt.after index cd0b3a1ec65..45608059817 100644 --- a/idea/testData/inspectionsLocal/trailingComma/changeCommaPosition.kt.after +++ b/idea/testData/inspectionsLocal/trailingComma/changeCommaPosition.kt.after @@ -2,7 +2,7 @@ // FIX: Fix comma position fun a( - i: Int, /* + i: Int, /* */ - b: Boolean, + b: Boolean, ) = Unit \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/trailingComma/changeCommaPosition2.kt.after b/idea/testData/inspectionsLocal/trailingComma/changeCommaPosition2.kt.after index cd0b3a1ec65..45608059817 100644 --- a/idea/testData/inspectionsLocal/trailingComma/changeCommaPosition2.kt.after +++ b/idea/testData/inspectionsLocal/trailingComma/changeCommaPosition2.kt.after @@ -2,7 +2,7 @@ // FIX: Fix comma position fun a( - i: Int, /* + i: Int, /* */ - b: Boolean, + b: Boolean, ) = Unit \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/trailingComma/changeCommaPosition5.kt.after b/idea/testData/inspectionsLocal/trailingComma/changeCommaPosition5.kt.after index bbf896eb1dd..a8cec345202 100644 --- a/idea/testData/inspectionsLocal/trailingComma/changeCommaPosition5.kt.after +++ b/idea/testData/inspectionsLocal/trailingComma/changeCommaPosition5.kt.after @@ -2,8 +2,8 @@ // FIX: Fix comma position val x = { - x: Comparable>, - y: String, + x: Comparable>, + y: String, -> val a = 42 } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/trailingComma/missingLineBreak.kt.after b/idea/testData/inspectionsLocal/trailingComma/missingLineBreak.kt.after index a3c0b5a590d..5859f5397c7 100644 --- a/idea/testData/inspectionsLocal/trailingComma/missingLineBreak.kt.after +++ b/idea/testData/inspectionsLocal/trailingComma/missingLineBreak.kt.after @@ -2,6 +2,6 @@ // FIX: Add line break fun a( - i: Int, - b: Boolean, + i: Int, + b: Boolean, ) = Unit \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/trailingComma/missingLineBreak2.kt.after b/idea/testData/inspectionsLocal/trailingComma/missingLineBreak2.kt.after index a3c0b5a590d..5859f5397c7 100644 --- a/idea/testData/inspectionsLocal/trailingComma/missingLineBreak2.kt.after +++ b/idea/testData/inspectionsLocal/trailingComma/missingLineBreak2.kt.after @@ -2,6 +2,6 @@ // FIX: Add line break fun a( - i: Int, - b: Boolean, + i: Int, + b: Boolean, ) = Unit \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/trailingComma/missingLineBreak3.kt.after b/idea/testData/inspectionsLocal/trailingComma/missingLineBreak3.kt.after index a3c0b5a590d..5859f5397c7 100644 --- a/idea/testData/inspectionsLocal/trailingComma/missingLineBreak3.kt.after +++ b/idea/testData/inspectionsLocal/trailingComma/missingLineBreak3.kt.after @@ -2,6 +2,6 @@ // FIX: Add line break fun a( - i: Int, - b: Boolean, + i: Int, + b: Boolean, ) = Unit \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/keepComments/2.kt.after b/idea/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/keepComments/2.kt.after index ffbe02a85ab..c1ed3261976 100644 --- a/idea/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/keepComments/2.kt.after +++ b/idea/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/keepComments/2.kt.after @@ -1,2 +1,2 @@ fun getText(): String =// let's return xxx - "xxx" //TODO + "xxx" //TODO diff --git a/idea/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/keepComments/3.kt.after b/idea/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/keepComments/3.kt.after index e8dd7b52cab..c4e5a436bbc 100644 --- a/idea/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/keepComments/3.kt.after +++ b/idea/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/keepComments/3.kt.after @@ -1,2 +1,2 @@ fun getText(): String =// let's return xxx - "xxx" \ No newline at end of file + "xxx" \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/keepComments/4.kt.after b/idea/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/keepComments/4.kt.after index 01cf2ef0bf2..f4c9fcd036e 100644 --- a/idea/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/keepComments/4.kt.after +++ b/idea/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/keepComments/4.kt.after @@ -1,2 +1,2 @@ fun getText(): String =/* let's return xxx */ - "xxx" /* TODO */ \ No newline at end of file + "xxx" /* TODO */ \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/useExpressionBody/if.kt.after b/idea/testData/inspectionsLocal/useExpressionBody/if.kt.after index 7c1e59246d4..5a833f44ca8 100644 --- a/idea/testData/inspectionsLocal/useExpressionBody/if.kt.after +++ b/idea/testData/inspectionsLocal/useExpressionBody/if.kt.after @@ -1,9 +1,9 @@ // HIGHLIGHT: INFORMATION fun abs(x: Int): Int =// No highlighting here - if (x > 0) { - x - } - else { - -x - } \ No newline at end of file + if (x > 0) { + x + } + else { + -x + } \ No newline at end of file diff --git a/idea/testData/inspectionsLocal/useExpressionBody/veryVeryLong.kt.after b/idea/testData/inspectionsLocal/useExpressionBody/veryVeryLong.kt.after index aac8938fae3..3c23e3fb3ab 100644 --- a/idea/testData/inspectionsLocal/useExpressionBody/veryVeryLong.kt.after +++ b/idea/testData/inspectionsLocal/useExpressionBody/veryVeryLong.kt.after @@ -1,4 +1,4 @@ fun foo(s1: String, s2: String) = s1 + s2 fun bar(): String = - foo("gjahkrgkjuyrtetyuairytoiuyareoihuyitouy897304hkdjgnba", "uiyiuye987130423toiuywtuiyrwityriwyhw") \ No newline at end of file + foo("gjahkrgkjuyrtetyuairytoiuyareoihuyitouy897304hkdjgnba", "uiyiuye987130423toiuywtuiyrwityriwyhw") \ No newline at end of file diff --git a/idea/testData/intentions/branched/doubleBangToIfThen/exceptionTextHandlesMultiline.kt.after b/idea/testData/intentions/branched/doubleBangToIfThen/exceptionTextHandlesMultiline.kt.after index 62e01fdfc46..e8dfa43d50c 100644 --- a/idea/testData/intentions/branched/doubleBangToIfThen/exceptionTextHandlesMultiline.kt.after +++ b/idea/testData/intentions/branched/doubleBangToIfThen/exceptionTextHandlesMultiline.kt.after @@ -1,9 +1,12 @@ // WITH_RUNTIME fun main(args: Array) { - val doSomething = doSomething("one" + 1, - "two", - 3 * 4) - val t = if (doSomething != null) doSomething else throw NullPointerException("Expression 'doSomething(\"one\" + 1, ...' must not be null") + val doSomething = doSomething( + "one" + 1, + "two", + 3 * 4 + ) + val t = if (doSomething != null + ) doSomething else throw NullPointerException("Expression 'doSomething(\"one\" + 1, ...' must not be null") } fun doSomething(vararg a: Any): Any? = null diff --git a/idea/testData/intentions/branched/ifWhen/ifToWhen/ifElseSwallowComments.kt.after b/idea/testData/intentions/branched/ifWhen/ifToWhen/ifElseSwallowComments.kt.after index 0efe9ea6a79..87bb2a3d3f7 100644 --- a/idea/testData/intentions/branched/ifWhen/ifToWhen/ifElseSwallowComments.kt.after +++ b/idea/testData/intentions/branched/ifWhen/ifToWhen/ifElseSwallowComments.kt.after @@ -2,7 +2,7 @@ fun foo(arg: Int): Int { // 1 when (arg) { 0 -> return 0 -// 2 + // 2 else -> return -1 } } \ No newline at end of file diff --git a/idea/testData/intentions/branched/ifWhen/ifToWhen/multipleIfWithReturns.kt.after b/idea/testData/intentions/branched/ifWhen/ifToWhen/multipleIfWithReturns.kt.after index 29c2545dd02..6d2360c4207 100644 --- a/idea/testData/intentions/branched/ifWhen/ifToWhen/multipleIfWithReturns.kt.after +++ b/idea/testData/intentions/branched/ifWhen/ifToWhen/multipleIfWithReturns.kt.after @@ -4,17 +4,17 @@ fun foo(arg: Any?): Int { is Int -> { return arg // 2 } -// 3 + // 3 is String -> { return 42 // 4 } -// 5 + // 5 null -> { // 6 return 0 } -// 7 -// 8 + // 7 + // 8 else -> return -1 } } \ No newline at end of file diff --git a/idea/testData/intentions/branched/ifWhen/whenToIf/comment.kt.after b/idea/testData/intentions/branched/ifWhen/whenToIf/comment.kt.after index 5ef39ef2176..fa1983b57a5 100644 --- a/idea/testData/intentions/branched/ifWhen/whenToIf/comment.kt.after +++ b/idea/testData/intentions/branched/ifWhen/whenToIf/comment.kt.after @@ -1,5 +1,5 @@ fun foo(b: Boolean) { if (// comment 1 - b) 1 // comment 2 + b) 1 // comment 2 else 2 } \ No newline at end of file diff --git a/idea/testData/intentions/branched/ifWhen/whenToIf/kt12040.kt.after b/idea/testData/intentions/branched/ifWhen/whenToIf/kt12040.kt.after index 21564a4448e..a1f052e0ea0 100644 --- a/idea/testData/intentions/branched/ifWhen/whenToIf/kt12040.kt.after +++ b/idea/testData/intentions/branched/ifWhen/whenToIf/kt12040.kt.after @@ -1,7 +1,8 @@ fun foo(a: Int) { if (a - // some comment - == 0) bar(a) + // some comment + == 0 + ) bar(a) // another comment else if (a == 1) bar(a) diff --git a/idea/testData/intentions/chop/argumentList/threeArgs.kt.after b/idea/testData/intentions/chop/argumentList/threeArgs.kt.after index 3d0f06d3032..489cbdf0b98 100644 --- a/idea/testData/intentions/chop/argumentList/threeArgs.kt.after +++ b/idea/testData/intentions/chop/argumentList/threeArgs.kt.after @@ -1,8 +1,8 @@ fun f() { foo( - 1, - "a", - 2 + 1, + "a", + 2 ) } diff --git a/idea/testData/intentions/chop/argumentList/threeArgsWithTrailingComma.kt.after b/idea/testData/intentions/chop/argumentList/threeArgsWithTrailingComma.kt.after index de596616291..16cdeda6724 100644 --- a/idea/testData/intentions/chop/argumentList/threeArgsWithTrailingComma.kt.after +++ b/idea/testData/intentions/chop/argumentList/threeArgsWithTrailingComma.kt.after @@ -3,9 +3,9 @@ fun f() { foo( - 1, - "a", - 2, + 1, + "a", + 2, ) } diff --git a/idea/testData/intentions/chop/parameterList/hasSomeLineBreaks1.kt.after b/idea/testData/intentions/chop/parameterList/hasSomeLineBreaks1.kt.after index 79ed12c3c76..036da90597e 100644 --- a/idea/testData/intentions/chop/parameterList/hasSomeLineBreaks1.kt.after +++ b/idea/testData/intentions/chop/parameterList/hasSomeLineBreaks1.kt.after @@ -1,6 +1,6 @@ fun foo( - p: Int, - c: Char, - b: Boolean + p: Int, + c: Char, + b: Boolean ) { } \ No newline at end of file diff --git a/idea/testData/intentions/chop/parameterList/hasSomeLineBreaks1WithTrailingComma.kt.after b/idea/testData/intentions/chop/parameterList/hasSomeLineBreaks1WithTrailingComma.kt.after index 3a0e640eb48..2b593423fe4 100644 --- a/idea/testData/intentions/chop/parameterList/hasSomeLineBreaks1WithTrailingComma.kt.after +++ b/idea/testData/intentions/chop/parameterList/hasSomeLineBreaks1WithTrailingComma.kt.after @@ -1,8 +1,8 @@ // SET_TRUE: ALLOW_TRAILING_COMMA fun foo( - p: Int, - c: Char, - b: Boolean, + p: Int, + c: Char, + b: Boolean, ) { } \ No newline at end of file diff --git a/idea/testData/intentions/chop/parameterList/hasSomeLineBreaks2.kt.after b/idea/testData/intentions/chop/parameterList/hasSomeLineBreaks2.kt.after index 79ed12c3c76..036da90597e 100644 --- a/idea/testData/intentions/chop/parameterList/hasSomeLineBreaks2.kt.after +++ b/idea/testData/intentions/chop/parameterList/hasSomeLineBreaks2.kt.after @@ -1,6 +1,6 @@ fun foo( - p: Int, - c: Char, - b: Boolean + p: Int, + c: Char, + b: Boolean ) { } \ No newline at end of file diff --git a/idea/testData/intentions/chop/parameterList/threeParameters.kt.after b/idea/testData/intentions/chop/parameterList/threeParameters.kt.after index 79ed12c3c76..036da90597e 100644 --- a/idea/testData/intentions/chop/parameterList/threeParameters.kt.after +++ b/idea/testData/intentions/chop/parameterList/threeParameters.kt.after @@ -1,6 +1,6 @@ fun foo( - p: Int, - c: Char, - b: Boolean + p: Int, + c: Char, + b: Boolean ) { } \ No newline at end of file diff --git a/idea/testData/intentions/chop/parameterList/twoParameters.kt.after b/idea/testData/intentions/chop/parameterList/twoParameters.kt.after index 4bcadde1866..d35cc3b2f12 100644 --- a/idea/testData/intentions/chop/parameterList/twoParameters.kt.after +++ b/idea/testData/intentions/chop/parameterList/twoParameters.kt.after @@ -1,5 +1,5 @@ fun foo( - p: Int, - c: Char + p: Int, + c: Char ) { } \ No newline at end of file diff --git a/idea/testData/intentions/convertSecondaryConstructorToPrimary/withComments.kt.after b/idea/testData/intentions/convertSecondaryConstructorToPrimary/withComments.kt.after index dcc3cce5813..8fa60db87e2 100644 --- a/idea/testData/intentions/convertSecondaryConstructorToPrimary/withComments.kt.after +++ b/idea/testData/intentions/convertSecondaryConstructorToPrimary/withComments.kt.after @@ -2,9 +2,10 @@ class WithComments/* Some parameter */ /** * A constructor */( - /** - * A very important property - */ - val veryImportant: Any) { + /** + * A very important property + */ + val veryImportant: Any +) { } \ No newline at end of file diff --git a/idea/testData/intentions/convertSecondaryConstructorToPrimary/withComposedModifiers.kt.after b/idea/testData/intentions/convertSecondaryConstructorToPrimary/withComposedModifiers.kt.after index c8625bcf83e..fda63e14159 100644 --- a/idea/testData/intentions/convertSecondaryConstructorToPrimary/withComposedModifiers.kt.after +++ b/idea/testData/intentions/convertSecondaryConstructorToPrimary/withComposedModifiers.kt.after @@ -2,7 +2,9 @@ annotation class AnnParam annotation class AnnProperty -abstract class WithComposedModifiers(@AnnParam vararg @AnnProperty -open val x: String) { +abstract class WithComposedModifiers( + @AnnParam vararg @AnnProperty + open val x: String +) { } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/KT14191.kt.after b/idea/testData/intentions/loopToCallChain/KT14191.kt.after index 66e67079fec..b63311d981a 100644 --- a/idea/testData/intentions/loopToCallChain/KT14191.kt.after +++ b/idea/testData/intentions/loopToCallChain/KT14191.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNotNull().sum()'" fun f(list: List): Int{ val r = list - .filterNotNull() - .sum() + .filterNotNull() + .sum() return r } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/KT14191.kt.after2 b/idea/testData/intentions/loopToCallChain/KT14191.kt.after2 index eee1e4d4476..3553d767776 100644 --- a/idea/testData/intentions/loopToCallChain/KT14191.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/KT14191.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNotNull().sum()'" fun f(list: List): Int{ val r = list - .asSequence() - .filterNotNull() - .sum() + .asSequence() + .filterNotNull() + .sum() return r } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/any/indexNeeded.kt.after b/idea/testData/intentions/loopToCallChain/any/indexNeeded.kt.after index 1180d8e93e8..d8522ce4425 100644 --- a/idea/testData/intentions/loopToCallChain/any/indexNeeded.kt.after +++ b/idea/testData/intentions/loopToCallChain/any/indexNeeded.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIndexed{}.any()'" fun foo(list: List) { val found = list - .filterIndexed { index, s -> s.length > index } - .any() + .filterIndexed { index, s -> s.length > index } + .any() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/any/indexNeeded.kt.after2 b/idea/testData/intentions/loopToCallChain/any/indexNeeded.kt.after2 index 6b9401a511d..d8df344e13b 100644 --- a/idea/testData/intentions/loopToCallChain/any/indexNeeded.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/any/indexNeeded.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIndexed{}.any()'" fun foo(list: List) { val found = list - .asSequence() - .filterIndexed { index, s -> s.length > index } - .any() + .asSequence() + .filterIndexed { index, s -> s.length > index } + .any() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/asSequenceOnly.kt.after2 b/idea/testData/intentions/loopToCallChain/asSequenceOnly.kt.after2 index 297c28eb432..8fca21accbf 100644 --- a/idea/testData/intentions/loopToCallChain/asSequenceOnly.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/asSequenceOnly.kt.after2 @@ -4,9 +4,9 @@ fun getMaxLineWidth(lineCount: Int): Float { var max_width = 0.0f (0..lineCount - 1) - .asSequence() - .filter { getLineWidth(it) > max_width } - .forEach { max_width = getLineWidth(it) } + .asSequence() + .filter { getLineWidth(it) > max_width } + .forEach { max_width = getLineWidth(it) } return max_width } diff --git a/idea/testData/intentions/loopToCallChain/count/long.kt.after b/idea/testData/intentions/loopToCallChain/count/long.kt.after index e1b9db4157c..2e84fe6ec7b 100644 --- a/idea/testData/intentions/loopToCallChain/count/long.kt.after +++ b/idea/testData/intentions/loopToCallChain/count/long.kt.after @@ -4,7 +4,7 @@ fun foo(list: List): Long { var count = 0L list - .filter { it.length > 10 } - .forEach { count++ } + .filter { it.length > 10 } + .forEach { count++ } return count } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/count/long.kt.after2 b/idea/testData/intentions/loopToCallChain/count/long.kt.after2 index bbe485c5103..17c09852c63 100644 --- a/idea/testData/intentions/loopToCallChain/count/long.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/count/long.kt.after2 @@ -4,8 +4,8 @@ fun foo(list: List): Long { var count = 0L list - .asSequence() - .filter { it.length > 10 } - .forEach { count++ } + .asSequence() + .filter { it.length > 10 } + .forEach { count++ } return count } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/count/variableUsedBefore.kt.after2 b/idea/testData/intentions/loopToCallChain/count/variableUsedBefore.kt.after2 index 1a8467bc02c..9ba641d3493 100644 --- a/idea/testData/intentions/loopToCallChain/count/variableUsedBefore.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/count/variableUsedBefore.kt.after2 @@ -4,8 +4,8 @@ fun foo(list: List): Int { var count = 0 list - .asSequence() - .filter { it.length > count } - .forEach { count++ } + .asSequence() + .filter { it.length > count } + .forEach { count++ } return count } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/assign_MutableListRequired.kt.after b/idea/testData/intentions/loopToCallChain/filter/assign_MutableListRequired.kt.after index adb1104bfcf..c90212bf0e3 100644 --- a/idea/testData/intentions/loopToCallChain/filter/assign_MutableListRequired.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/assign_MutableListRequired.kt.after @@ -5,7 +5,7 @@ import java.util.ArrayList fun foo(list: List): MutableList { val result = list - .filter { it.length > 0 } - .toMutableList() + .filter { it.length > 0 } + .toMutableList() return result } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/assign_MutableListRequired.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/assign_MutableListRequired.kt.after2 index 2d32fbe2898..923d18caf99 100644 --- a/idea/testData/intentions/loopToCallChain/filter/assign_MutableListRequired.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/assign_MutableListRequired.kt.after2 @@ -5,8 +5,8 @@ import java.util.ArrayList fun foo(list: List): MutableList { val result = list - .asSequence() - .filter { it.length > 0 } - .toMutableList() + .asSequence() + .filter { it.length > 0 } + .toMutableList() return result } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/doNotSplitOutFilterNotNull.kt.after b/idea/testData/intentions/loopToCallChain/filter/doNotSplitOutFilterNotNull.kt.after index a1815e2b048..d2919ceab26 100644 --- a/idea/testData/intentions/loopToCallChain/filter/doNotSplitOutFilterNotNull.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/doNotSplitOutFilterNotNull.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.forEach{}'" fun foo(list: List){ list - .filter { it != null && it.startsWith("IMG:") } - .forEach { println(it) } + .filter { it != null && it.startsWith("IMG:") } + .forEach { println(it) } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/doNotSplitOutFilterNotNull.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/doNotSplitOutFilterNotNull.kt.after2 index 34477a27b10..cf680b22c4b 100644 --- a/idea/testData/intentions/loopToCallChain/filter/doNotSplitOutFilterNotNull.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/doNotSplitOutFilterNotNull.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.forEach{}'" fun foo(list: List){ list - .asSequence() - .filter { it != null && it.startsWith("IMG:") } - .forEach { println(it) } + .asSequence() + .filter { it != null && it.startsWith("IMG:") } + .forEach { println(it) } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIndexed.kt.after b/idea/testData/intentions/loopToCallChain/filter/filterIndexed.kt.after index c2472f0b8dd..1fca72f9826 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIndexed.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/filterIndexed.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIndexed{}.firstOrNull()'" fun foo(list: List): String? { return list - .filterIndexed { index, s -> s.length > index } - .firstOrNull() + .filterIndexed { index, s -> s.length > index } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIndexed.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/filterIndexed.kt.after2 index ed0fdb27141..39e1f464809 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIndexed.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/filterIndexed.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIndexed{}.firstOrNull()'" fun foo(list: List): String? { return list - .asSequence() - .filterIndexed { index, s -> s.length > index } - .firstOrNull() + .asSequence() + .filterIndexed { index, s -> s.length > index } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIndexed2.kt.after b/idea/testData/intentions/loopToCallChain/filter/filterIndexed2.kt.after index c9681aa6f0f..55fae937244 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIndexed2.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/filterIndexed2.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIndexed{}.firstOrNull()'" fun foo(list: List): String? { return list - .filterIndexed { i, s -> s.length > i } - .firstOrNull() + .filterIndexed { i, s -> s.length > i } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIndexed2.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/filterIndexed2.kt.after2 index 830c8d0148c..0f3c6a8ad49 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIndexed2.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/filterIndexed2.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIndexed{}.firstOrNull()'" fun foo(list: List): String? { return list - .asSequence() - .filterIndexed { i, s -> s.length > i } - .firstOrNull() + .asSequence() + .filterIndexed { i, s -> s.length > i } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIndexedAndFlatMapWithContinue.kt.after b/idea/testData/intentions/loopToCallChain/filter/filterIndexedAndFlatMapWithContinue.kt.after index 1922e73963c..c2c545cccd3 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIndexedAndFlatMapWithContinue.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/filterIndexedAndFlatMapWithContinue.kt.after @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence()...flatMap{}.filter{}.mapTo(){}'" fun foo(list: List, target: MutableCollection) { list - .filterIndexed { i, s -> i % 10 != 0 } - .flatMap { it.indices } - .filter { it != 10 } - .mapTo(target) { it.toString() } + .filterIndexed { i, s -> i % 10 != 0 } + .flatMap { it.indices } + .filter { it != 10 } + .mapTo(target) { it.toString() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIndexedAndFlatMapWithContinue.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/filterIndexedAndFlatMapWithContinue.kt.after2 index aee8fbcf71c..0858f452dc0 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIndexedAndFlatMapWithContinue.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/filterIndexedAndFlatMapWithContinue.kt.after2 @@ -3,9 +3,9 @@ // INTENTION_TEXT_2: "Replace with 'asSequence()...flatMap{}.filter{}.mapTo(){}'" fun foo(list: List, target: MutableCollection) { list - .asSequence() - .filterIndexed { i, s -> i % 10 != 0 } - .flatMap { it.indices.asSequence() } - .filter { it != 10 } - .mapTo(target) { it.toString() } + .asSequence() + .filterIndexed { i, s -> i % 10 != 0 } + .flatMap { it.indices.asSequence() } + .filter { it != 10 } + .mapTo(target) { it.toString() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge1.kt.after b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge1.kt.after index 1203ddea360..5f0c887df8e 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge1.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge1.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIndexed{}.firstOrNull()'" fun foo(list: List): String? { return list - .filterIndexed { index, s -> s.length <= index * 10 && s.length > index } - .firstOrNull() + .filterIndexed { index, s -> s.length <= index * 10 && s.length > index } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge1.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge1.kt.after2 index 96b28dd21a9..0265730ff7a 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge1.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge1.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIndexed{}.firstOrNull()'" fun foo(list: List): String? { return list - .asSequence() - .filterIndexed { index, s -> s.length <= index * 10 && s.length > index } - .firstOrNull() + .asSequence() + .filterIndexed { index, s -> s.length <= index * 10 && s.length > index } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge2.kt.after b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge2.kt.after index 6fdaa80c271..455a6154e07 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge2.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge2.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIndexed{}.firstOrNull()'" fun foo(list: List): String? { return list - .filterIndexed { index, s -> !s.isBlank() && s.length > index } - .firstOrNull() + .filterIndexed { index, s -> !s.isBlank() && s.length > index } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge2.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge2.kt.after2 index aa40e164b08..14688d8226f 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge2.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge2.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIndexed{}.firstOrNull()'" fun foo(list: List): String? { return list - .asSequence() - .filterIndexed { index, s -> !s.isBlank() && s.length > index } - .firstOrNull() + .asSequence() + .filterIndexed { index, s -> !s.isBlank() && s.length > index } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge3.kt.after b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge3.kt.after index b1342807c07..232347db884 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge3.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge3.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIndexed{}.firstOrNull()'" fun foo(list: List): String? { return list - .filterIndexed { index, s -> s.length <= index && s.isNotBlank() } - .firstOrNull() + .filterIndexed { index, s -> s.length <= index && s.isNotBlank() } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge3.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge3.kt.after2 index e8d26f594bd..6f5c252129f 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge3.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge3.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIndexed{}.firstOrNull()'" fun foo(list: List): String? { return list - .asSequence() - .filterIndexed { index, s -> s.length <= index && s.isNotBlank() } - .firstOrNull() + .asSequence() + .filterIndexed { index, s -> s.length <= index && s.isNotBlank() } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge4.kt.after b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge4.kt.after index 5393146e1a5..5f7d0798f31 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge4.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge4.kt.after @@ -4,6 +4,6 @@ fun foo(list: List): String? { var index2 = 0 return list - .filterIndexed { index1, s -> s.length <= index1 && s.length >= index2++ } - .firstOrNull() + .filterIndexed { index1, s -> s.length <= index1 && s.length >= index2++ } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge4.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge4.kt.after2 index 6bdbbe1db78..3999b1d6f05 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge4.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_merge4.kt.after2 @@ -4,7 +4,7 @@ fun foo(list: List): String? { var index2 = 0 return list - .asSequence() - .filterIndexed { index1, s -> s.length <= index1 && s.length >= index2++ } - .firstOrNull() + .asSequence() + .filterIndexed { index1, s -> s.length <= index1 && s.length >= index2++ } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_twoIndices.kt.after b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_twoIndices.kt.after index 88355ecf23a..31c47447aa9 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_twoIndices.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_twoIndices.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIndexed{}.filterIndexedTo(){}'" fun foo(list: List, target: MutableCollection) { list - .filterIndexed { i, s -> s.length <= i } - .filterIndexedTo(target) { j, s -> s.length % j == 0 } + .filterIndexed { i, s -> s.length <= i } + .filterIndexedTo(target) { j, s -> s.length % j == 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_twoIndices.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_twoIndices.kt.after2 index 33585c6432c..6b9579f3ff5 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIndexed_twoIndices.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/filterIndexed_twoIndices.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIndexed{}.filterIndexedTo(){}'" fun foo(list: List, target: MutableCollection) { list - .asSequence() - .filterIndexed { i, s -> s.length <= i } - .filterIndexedTo(target) { j, s -> s.length % j == 0 } + .asSequence() + .filterIndexed { i, s -> s.length <= i } + .filterIndexedTo(target) { j, s -> s.length % j == 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIsInstance.kt.after b/idea/testData/intentions/loopToCallChain/filter/filterIsInstance.kt.after index 5110045d434..9a54696cf67 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIsInstance.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/filterIsInstance.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIsInstance<>().map{}.firstOrNull()'" fun foo(list: List): Int? { return list - .filterIsInstance() - .map { it.length } - .firstOrNull() + .filterIsInstance() + .map { it.length } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIsInstance.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/filterIsInstance.kt.after2 index 8fd72f3b20e..9b64cf3c87f 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIsInstance.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/filterIsInstance.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIsInstance<>().map{}.firstOrNull()'" fun foo(list: List): Int? { return list - .asSequence() - .filterIsInstance() - .map { it.length } - .firstOrNull() + .asSequence() + .filterIsInstance() + .map { it.length } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIsInstanceTo.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/filterIsInstanceTo.kt.after2 index 72f76c67cf7..b9ba8d5bb57 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIsInstanceTo.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/filterIsInstanceTo.kt.after2 @@ -6,6 +6,6 @@ fun foo(list: List, target: MutableCollection) { target += list - .asSequence() - .filterIsInstance() + .asSequence() + .filterIsInstance() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIsInstance_ifContinue.kt.after b/idea/testData/intentions/loopToCallChain/filter/filterIsInstance_ifContinue.kt.after index 5110045d434..9a54696cf67 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIsInstance_ifContinue.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/filterIsInstance_ifContinue.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIsInstance<>().map{}.firstOrNull()'" fun foo(list: List): Int? { return list - .filterIsInstance() - .map { it.length } - .firstOrNull() + .filterIsInstance() + .map { it.length } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterIsInstance_ifContinue.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/filterIsInstance_ifContinue.kt.after2 index 8fd72f3b20e..9b64cf3c87f 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterIsInstance_ifContinue.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/filterIsInstance_ifContinue.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIsInstance<>().map{}.firstOrNull()'" fun foo(list: List): Int? { return list - .asSequence() - .filterIsInstance() - .map { it.length } - .firstOrNull() + .asSequence() + .filterIsInstance() + .map { it.length } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterNotNull.kt.after b/idea/testData/intentions/loopToCallChain/filter/filterNotNull.kt.after index 9c66d536cb3..48e25f3044c 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterNotNull.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/filterNotNull.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNotNull().map{}.firstOrNull()'" fun foo(list: List): Int? { return list - .filterNotNull() - .map { it.length } - .firstOrNull() + .filterNotNull() + .map { it.length } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterNotNull.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/filterNotNull.kt.after2 index c0e85ab584e..34e9516102d 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterNotNull.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/filterNotNull.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNotNull().map{}.firstOrNull()'" fun foo(list: List): Int? { return list - .asSequence() - .filterNotNull() - .map { it.length } - .firstOrNull() + .asSequence() + .filterNotNull() + .map { it.length } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterNotNull_ifContinue.kt.after b/idea/testData/intentions/loopToCallChain/filter/filterNotNull_ifContinue.kt.after index 4050363ae19..f2964ec58b3 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterNotNull_ifContinue.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/filterNotNull_ifContinue.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNotNull().map{}.firstOrNull()'" fun foo(list: List): Int? { return list - .filterNotNull() - .map { it.hashCode() } - .firstOrNull() + .filterNotNull() + .map { it.hashCode() } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterNotNull_ifContinue.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/filterNotNull_ifContinue.kt.after2 index 523c3b43562..85a6f6b9bdf 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterNotNull_ifContinue.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/filterNotNull_ifContinue.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNotNull().map{}.firstOrNull()'" fun foo(list: List): Int? { return list - .asSequence() - .filterNotNull() - .map { it.hashCode() } - .firstOrNull() + .asSequence() + .filterNotNull() + .map { it.hashCode() } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterNot_ifContinue.kt.after b/idea/testData/intentions/loopToCallChain/filter/filterNot_ifContinue.kt.after index f766b4a4271..bd5f2bd55cd 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterNot_ifContinue.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/filterNot_ifContinue.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNot{}.map{}.firstOrNull()'" fun foo(list: List): Int? { return list - .filterNot { it.isEmpty() } - .map { it.length } - .firstOrNull() + .filterNot { it.isEmpty() } + .map { it.length } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/filterNot_ifContinue.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/filterNot_ifContinue.kt.after2 index 607356a51ce..c5a2e147755 100644 --- a/idea/testData/intentions/loopToCallChain/filter/filterNot_ifContinue.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/filterNot_ifContinue.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNot{}.map{}.firstOrNull()'" fun foo(list: List): Int? { return list - .asSequence() - .filterNot { it.isEmpty() } - .map { it.length } - .firstOrNull() + .asSequence() + .filterNot { it.isEmpty() } + .map { it.length } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/glueTogetherFilterNotNull.kt.after b/idea/testData/intentions/loopToCallChain/filter/glueTogetherFilterNotNull.kt.after index a1815e2b048..d2919ceab26 100644 --- a/idea/testData/intentions/loopToCallChain/filter/glueTogetherFilterNotNull.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/glueTogetherFilterNotNull.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.forEach{}'" fun foo(list: List){ list - .filter { it != null && it.startsWith("IMG:") } - .forEach { println(it) } + .filter { it != null && it.startsWith("IMG:") } + .forEach { println(it) } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/glueTogetherFilterNotNull.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/glueTogetherFilterNotNull.kt.after2 index 34477a27b10..cf680b22c4b 100644 --- a/idea/testData/intentions/loopToCallChain/filter/glueTogetherFilterNotNull.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/glueTogetherFilterNotNull.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.forEach{}'" fun foo(list: List){ list - .asSequence() - .filter { it != null && it.startsWith("IMG:") } - .forEach { println(it) } + .asSequence() + .filter { it != null && it.startsWith("IMG:") } + .forEach { println(it) } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/mergeMultiple.kt.after b/idea/testData/intentions/loopToCallChain/filter/mergeMultiple.kt.after index 7d869d3a664..27fb2ea7504 100644 --- a/idea/testData/intentions/loopToCallChain/filter/mergeMultiple.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/mergeMultiple.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.map{}.firstOrNull()'" fun foo(list: List): String? { return list - .filter { !it.isEmpty() && it.length < 10 && it != "abc" && it != "def" } - .map { it + "x" } - .firstOrNull() + .filter { !it.isEmpty() && it.length < 10 && it != "abc" && it != "def" } + .map { it + "x" } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/mergeMultiple.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/mergeMultiple.kt.after2 index d39dd67a87c..0ac647b6a17 100644 --- a/idea/testData/intentions/loopToCallChain/filter/mergeMultiple.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/mergeMultiple.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.map{}.firstOrNull()'" fun foo(list: List): String? { return list - .asSequence() - .filter { !it.isEmpty() && it.length < 10 && it != "abc" && it != "def" } - .map { it + "x" } - .firstOrNull() + .asSequence() + .filter { !it.isEmpty() && it.length < 10 && it != "abc" && it != "def" } + .map { it + "x" } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/splitOutFilterIsInstance.kt.after b/idea/testData/intentions/loopToCallChain/filter/splitOutFilterIsInstance.kt.after index 08c8735e029..2767b65ff12 100644 --- a/idea/testData/intentions/loopToCallChain/filter/splitOutFilterIsInstance.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/splitOutFilterIsInstance.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIsInstance<>().filterTo(){}'" fun foo(list: List, out: MutableList){ list - .filterIsInstance() - .filterTo(out) { it.length > 0 } + .filterIsInstance() + .filterTo(out) { it.length > 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/splitOutFilterIsInstance.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/splitOutFilterIsInstance.kt.after2 index b6450e4f0a7..faa9d9f43f8 100644 --- a/idea/testData/intentions/loopToCallChain/filter/splitOutFilterIsInstance.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/splitOutFilterIsInstance.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIsInstance<>().filterTo(){}'" fun foo(list: List, out: MutableList){ list - .asSequence() - .filterIsInstance() - .filterTo(out) { it.length > 0 } + .asSequence() + .filterIsInstance() + .filterTo(out) { it.length > 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/splitOutFilterNotNull.kt.after b/idea/testData/intentions/loopToCallChain/filter/splitOutFilterNotNull.kt.after index e4917366821..55a99ce95ef 100644 --- a/idea/testData/intentions/loopToCallChain/filter/splitOutFilterNotNull.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/splitOutFilterNotNull.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNotNull().filter{}.forEach{}'" fun foo(list: List){ list - .filterNotNull() - .filter { it.startsWith("IMG:") } - .forEach { println(it.hashCode()) } + .filterNotNull() + .filter { it.startsWith("IMG:") } + .forEach { println(it.hashCode()) } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/splitOutFilterNotNull.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/splitOutFilterNotNull.kt.after2 index 0038389c1c2..30451be1533 100644 --- a/idea/testData/intentions/loopToCallChain/filter/splitOutFilterNotNull.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/splitOutFilterNotNull.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNotNull().filter{}.forEach{}'" fun foo(list: List){ list - .asSequence() - .filterNotNull() - .filter { it.startsWith("IMG:") } - .forEach { println(it.hashCode()) } + .asSequence() + .filterNotNull() + .filter { it.startsWith("IMG:") } + .forEach { println(it.hashCode()) } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/splitOutFilterNotNull2.kt.after b/idea/testData/intentions/loopToCallChain/filter/splitOutFilterNotNull2.kt.after index e4917366821..55a99ce95ef 100644 --- a/idea/testData/intentions/loopToCallChain/filter/splitOutFilterNotNull2.kt.after +++ b/idea/testData/intentions/loopToCallChain/filter/splitOutFilterNotNull2.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNotNull().filter{}.forEach{}'" fun foo(list: List){ list - .filterNotNull() - .filter { it.startsWith("IMG:") } - .forEach { println(it.hashCode()) } + .filterNotNull() + .filter { it.startsWith("IMG:") } + .forEach { println(it.hashCode()) } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/filter/splitOutFilterNotNull2.kt.after2 b/idea/testData/intentions/loopToCallChain/filter/splitOutFilterNotNull2.kt.after2 index 0038389c1c2..30451be1533 100644 --- a/idea/testData/intentions/loopToCallChain/filter/splitOutFilterNotNull2.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/filter/splitOutFilterNotNull2.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNotNull().filter{}.forEach{}'" fun foo(list: List){ list - .asSequence() - .filterNotNull() - .filter { it.startsWith("IMG:") } - .forEach { println(it.hashCode()) } + .asSequence() + .filterNotNull() + .filter { it.startsWith("IMG:") } + .forEach { println(it.hashCode()) } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/firstOrNull/let.kt.after b/idea/testData/intentions/loopToCallChain/firstOrNull/let.kt.after index 9d408c8e3f0..48e1fc2e3eb 100644 --- a/idea/testData/intentions/loopToCallChain/firstOrNull/let.kt.after +++ b/idea/testData/intentions/loopToCallChain/firstOrNull/let.kt.after @@ -3,8 +3,8 @@ // IS_APPLICABLE_2: false fun foo(list: List) { val result: String? = list - .firstOrNull { it.length > 0 } - ?.let { bar(it) } + .firstOrNull { it.length > 0 } + ?.let { bar(it) } } fun bar(s: String): String = s diff --git a/idea/testData/intentions/loopToCallChain/firstOrNull/let2.kt.after b/idea/testData/intentions/loopToCallChain/firstOrNull/let2.kt.after index b4c6da35ca5..dc8e3cbbd96 100644 --- a/idea/testData/intentions/loopToCallChain/firstOrNull/let2.kt.after +++ b/idea/testData/intentions/loopToCallChain/firstOrNull/let2.kt.after @@ -3,8 +3,8 @@ // IS_APPLICABLE_2: false fun foo(list: List) { val result: String? = list - .firstOrNull { it.length > 0 } - ?.let { it.substring(0, it.length - 1) } + .firstOrNull { it.length > 0 } + ?.let { it.substring(0, it.length - 1) } } fun bar(s: String): String = s diff --git a/idea/testData/intentions/loopToCallChain/firstOrNull/letOrNotNull.kt.after b/idea/testData/intentions/loopToCallChain/firstOrNull/letOrNotNull.kt.after index e5db524aadf..d0f6e7c1c92 100644 --- a/idea/testData/intentions/loopToCallChain/firstOrNull/letOrNotNull.kt.after +++ b/idea/testData/intentions/loopToCallChain/firstOrNull/letOrNotNull.kt.after @@ -3,9 +3,9 @@ // IS_APPLICABLE_2: false fun foo(list: List) { val result = list - .firstOrNull { it.length > 0 } - ?.let { bar(it) } - ?: "" + .firstOrNull { it.length > 0 } + ?.let { bar(it) } + ?: "" } fun bar(s: String): String = s diff --git a/idea/testData/intentions/loopToCallChain/firstOrNull/returnExpression.kt.after b/idea/testData/intentions/loopToCallChain/firstOrNull/returnExpression.kt.after index c4141f48083..e7145d2471f 100644 --- a/idea/testData/intentions/loopToCallChain/firstOrNull/returnExpression.kt.after +++ b/idea/testData/intentions/loopToCallChain/firstOrNull/returnExpression.kt.after @@ -3,6 +3,6 @@ // IS_APPLICABLE_2: false fun foo(list: List): Int? { return list - .firstOrNull { it.isNotEmpty() } - ?.length + .firstOrNull { it.isNotEmpty() } + ?.length } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/firstOrNull/returnExpressionOrNotNull.kt.after b/idea/testData/intentions/loopToCallChain/firstOrNull/returnExpressionOrNotNull.kt.after index dcffddc025b..c33d02414d3 100644 --- a/idea/testData/intentions/loopToCallChain/firstOrNull/returnExpressionOrNotNull.kt.after +++ b/idea/testData/intentions/loopToCallChain/firstOrNull/returnExpressionOrNotNull.kt.after @@ -3,7 +3,7 @@ // IS_APPLICABLE_2: false fun foo(list: List): Int { return list - .firstOrNull { it.isNotEmpty() } - ?.length - ?: -1 + .firstOrNull { it.isNotEmpty() } + ?.length + ?: -1 } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/firstOrNull/returnNotNullIfNone.kt.after b/idea/testData/intentions/loopToCallChain/firstOrNull/returnNotNullIfNone.kt.after index e672166bf20..949234a3afc 100644 --- a/idea/testData/intentions/loopToCallChain/firstOrNull/returnNotNullIfNone.kt.after +++ b/idea/testData/intentions/loopToCallChain/firstOrNull/returnNotNullIfNone.kt.after @@ -3,5 +3,5 @@ // IS_APPLICABLE_2: false fun foo(list: List): String { return list.firstOrNull { it.isNotEmpty() } - ?: "" + ?: "" } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/firstOrNull/safeDotExpression.kt.after b/idea/testData/intentions/loopToCallChain/firstOrNull/safeDotExpression.kt.after index b1d1eabb51f..c7cf7e2496b 100644 --- a/idea/testData/intentions/loopToCallChain/firstOrNull/safeDotExpression.kt.after +++ b/idea/testData/intentions/loopToCallChain/firstOrNull/safeDotExpression.kt.after @@ -3,6 +3,6 @@ // IS_APPLICABLE_2: false fun foo(list: List) { val result: String? = list - .firstOrNull { it != "" } - ?.substring(1) + .firstOrNull { it != "" } + ?.substring(1) } diff --git a/idea/testData/intentions/loopToCallChain/flatMap/break.kt.after b/idea/testData/intentions/loopToCallChain/flatMap/break.kt.after index 0b364a2fbf8..968007625ac 100644 --- a/idea/testData/intentions/loopToCallChain/flatMap/break.kt.after +++ b/idea/testData/intentions/loopToCallChain/flatMap/break.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().flatMap{}.firstOrNull{}'" fun foo(list: List): String? { val result: String? = list - .flatMap { it.lines() } - .firstOrNull { it.isNotBlank() } + .flatMap { it.lines() } + .firstOrNull { it.isNotBlank() } return result } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/flatMap/break.kt.after2 b/idea/testData/intentions/loopToCallChain/flatMap/break.kt.after2 index 3e5fbb122fa..fa420e84c41 100644 --- a/idea/testData/intentions/loopToCallChain/flatMap/break.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/flatMap/break.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().flatMap{}.firstOrNull{}'" fun foo(list: List): String? { val result: String? = list - .asSequence() - .flatMap { it.lines().asSequence() } - .firstOrNull { it.isNotBlank() } + .asSequence() + .flatMap { it.lines().asSequence() } + .firstOrNull { it.isNotBlank() } return result } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/flatMap/continue.kt.after b/idea/testData/intentions/loopToCallChain/flatMap/continue.kt.after index 8730a928a67..625b0f498bf 100644 --- a/idea/testData/intentions/loopToCallChain/flatMap/continue.kt.after +++ b/idea/testData/intentions/loopToCallChain/flatMap/continue.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().flatMap{}.firstOrNull{}'" fun foo(list: List): String? { return list - .flatMap { it.lines() } - .firstOrNull { !it.isBlank() } + .flatMap { it.lines() } + .firstOrNull { !it.isBlank() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/flatMap/continue.kt.after2 b/idea/testData/intentions/loopToCallChain/flatMap/continue.kt.after2 index 987487a901d..c361fc45a10 100644 --- a/idea/testData/intentions/loopToCallChain/flatMap/continue.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/flatMap/continue.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().flatMap{}.firstOrNull{}'" fun foo(list: List): String? { return list - .asSequence() - .flatMap { it.lines().asSequence() } - .firstOrNull { !it.isBlank() } + .asSequence() + .flatMap { it.lines().asSequence() } + .firstOrNull { !it.isBlank() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/flatMap/flatMapTo.kt.after2 b/idea/testData/intentions/loopToCallChain/flatMap/flatMapTo.kt.after2 index 0d35ff01a93..7207625e2df 100644 --- a/idea/testData/intentions/loopToCallChain/flatMap/flatMapTo.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/flatMap/flatMapTo.kt.after2 @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().flatMapTo(){}'" fun foo(list: List, target: MutableList) { list - .asSequence() - .flatMapTo(target) { it.lines().asSequence() } + .asSequence() + .flatMapTo(target) { it.lines().asSequence() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/flatMap/flatMapTo2.kt.after2 b/idea/testData/intentions/loopToCallChain/flatMap/flatMapTo2.kt.after2 index 74e0dce77c6..016cddce585 100644 --- a/idea/testData/intentions/loopToCallChain/flatMap/flatMapTo2.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/flatMap/flatMapTo2.kt.after2 @@ -5,7 +5,7 @@ import java.util.ArrayList fun foo(list: List): List { val target = list - .asSequence() - .flatMapTo(ArrayList(100)) { it.lines().asSequence() } + .asSequence() + .flatMapTo(ArrayList(100)) { it.lines().asSequence() } return target } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/flatMap/flatMapTo3.kt.after2 b/idea/testData/intentions/loopToCallChain/flatMap/flatMapTo3.kt.after2 index 215c601a26f..1fee3157f39 100644 --- a/idea/testData/intentions/loopToCallChain/flatMap/flatMapTo3.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/flatMap/flatMapTo3.kt.after2 @@ -4,8 +4,8 @@ fun foo(list: List): List { val target = createCollection() list - .asSequence() - .flatMapTo(target) { it.lines().asSequence() } + .asSequence() + .flatMapTo(target) { it.lines().asSequence() } return target } diff --git a/idea/testData/intentions/loopToCallChain/flatMap/indexUsed.kt.after b/idea/testData/intentions/loopToCallChain/flatMap/indexUsed.kt.after index 143816de9e1..6a46caf1c43 100644 --- a/idea/testData/intentions/loopToCallChain/flatMap/indexUsed.kt.after +++ b/idea/testData/intentions/loopToCallChain/flatMap/indexUsed.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.flatMap{}.firstOrNull{}'" fun foo(list: List): String? { return list - .mapIndexed { index, s -> s.lines().take(index) } - .flatMap { it } - .firstOrNull { it.isNotBlank() } + .mapIndexed { index, s -> s.lines().take(index) } + .flatMap { it } + .firstOrNull { it.isNotBlank() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/flatMap/indexUsed.kt.after2 b/idea/testData/intentions/loopToCallChain/flatMap/indexUsed.kt.after2 index 7be6eb75095..190fc4add60 100644 --- a/idea/testData/intentions/loopToCallChain/flatMap/indexUsed.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/flatMap/indexUsed.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.flatMap{}.firstOrNull{}'" fun foo(list: List): String? { return list - .asSequence() - .mapIndexed { index, s -> s.lines().take(index) } - .flatMap { it.asSequence() } - .firstOrNull { it.isNotBlank() } + .asSequence() + .mapIndexed { index, s -> s.lines().take(index) } + .flatMap { it.asSequence() } + .firstOrNull { it.isNotBlank() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/flatMap/simple.kt.after b/idea/testData/intentions/loopToCallChain/flatMap/simple.kt.after index 1c66c342193..76eecd13fbe 100644 --- a/idea/testData/intentions/loopToCallChain/flatMap/simple.kt.after +++ b/idea/testData/intentions/loopToCallChain/flatMap/simple.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().flatMap{}.firstOrNull{}'" fun foo(list: List): String? { return list - .flatMap { it.lines() } - .firstOrNull { it.isNotBlank() } + .flatMap { it.lines() } + .firstOrNull { it.isNotBlank() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/flatMap/simple.kt.after2 b/idea/testData/intentions/loopToCallChain/flatMap/simple.kt.after2 index ec05bfe20f6..7e956cb25dd 100644 --- a/idea/testData/intentions/loopToCallChain/flatMap/simple.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/flatMap/simple.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().flatMap{}.firstOrNull{}'" fun foo(list: List): String? { return list - .asSequence() - .flatMap { it.lines().asSequence() } - .firstOrNull { it.isNotBlank() } + .asSequence() + .flatMap { it.lines().asSequence() } + .firstOrNull { it.isNotBlank() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/forEach/KT14341.kt.after b/idea/testData/intentions/loopToCallChain/forEach/KT14341.kt.after index 800a54f6d15..9aa22c1a89a 100644 --- a/idea/testData/intentions/loopToCallChain/forEach/KT14341.kt.after +++ b/idea/testData/intentions/loopToCallChain/forEach/KT14341.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.forEach{}'" fun foo(list: List){ list - .filter { it > 0 } - .forEach { println("positive number") } + .filter { it > 0 } + .forEach { println("positive number") } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/forEach/KT14341.kt.after2 b/idea/testData/intentions/loopToCallChain/forEach/KT14341.kt.after2 index 500b76eb22e..fa38f21e280 100644 --- a/idea/testData/intentions/loopToCallChain/forEach/KT14341.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/forEach/KT14341.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.forEach{}'" fun foo(list: List){ list - .asSequence() - .filter { it > 0 } - .forEach { println("positive number") } + .asSequence() + .filter { it > 0 } + .forEach { println("positive number") } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/forEach/indexed.kt.after b/idea/testData/intentions/loopToCallChain/forEach/indexed.kt.after index 0d4506e88f8..a2df71859d8 100644 --- a/idea/testData/intentions/loopToCallChain/forEach/indexed.kt.after +++ b/idea/testData/intentions/loopToCallChain/forEach/indexed.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.forEachIndexed{}'" fun foo(list: List) { list - .map { it.substring(1) } - .forEachIndexed { index, s1 -> println(s1.hashCode() * index) } + .map { it.substring(1) } + .forEachIndexed { index, s1 -> println(s1.hashCode() * index) } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/forEach/indexed.kt.after2 b/idea/testData/intentions/loopToCallChain/forEach/indexed.kt.after2 index 1cd5747b841..6db83a40a6a 100644 --- a/idea/testData/intentions/loopToCallChain/forEach/indexed.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/forEach/indexed.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.forEachIndexed{}'" fun foo(list: List) { list - .asSequence() - .map { it.substring(1) } - .forEachIndexed { index, s1 -> println(s1.hashCode() * index) } + .asSequence() + .map { it.substring(1) } + .forEachIndexed { index, s1 -> println(s1.hashCode() * index) } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/forEach/notIndexed.kt.after b/idea/testData/intentions/loopToCallChain/forEach/notIndexed.kt.after index 2d26b6a0d58..e497805d97e 100644 --- a/idea/testData/intentions/loopToCallChain/forEach/notIndexed.kt.after +++ b/idea/testData/intentions/loopToCallChain/forEach/notIndexed.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.forEach{}'" fun foo(list: List) { list - .mapIndexed { index, s -> s.length * index } - .forEach { println(it) } + .mapIndexed { index, s -> s.length * index } + .forEach { println(it) } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/forEach/notIndexed.kt.after2 b/idea/testData/intentions/loopToCallChain/forEach/notIndexed.kt.after2 index 85a46bfd6b2..4895991d32a 100644 --- a/idea/testData/intentions/loopToCallChain/forEach/notIndexed.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/forEach/notIndexed.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.forEach{}'" fun foo(list: List) { list - .asSequence() - .mapIndexed { index, s -> s.length * index } - .forEach { println(it) } + .asSequence() + .mapIndexed { index, s -> s.length * index } + .forEach { println(it) } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/forEach/simple.kt.after b/idea/testData/intentions/loopToCallChain/forEach/simple.kt.after index 1443c5f941c..63513ed8be3 100644 --- a/idea/testData/intentions/loopToCallChain/forEach/simple.kt.after +++ b/idea/testData/intentions/loopToCallChain/forEach/simple.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.forEach{}'" fun foo(list: List) { list - .filter { it.isNotBlank() } - .forEach { println(it) } + .filter { it.isNotBlank() } + .forEach { println(it) } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/forEach/simple.kt.after2 b/idea/testData/intentions/loopToCallChain/forEach/simple.kt.after2 index 549fdd70011..302b037a383 100644 --- a/idea/testData/intentions/loopToCallChain/forEach/simple.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/forEach/simple.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.forEach{}'" fun foo(list: List) { list - .asSequence() - .filter { it.isNotBlank() } - .forEach { println(it) } + .asSequence() + .filter { it.isNotBlank() } + .forEach { println(it) } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression.kt.after b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression.kt.after index 29afe43e596..8a11065ab26 100644 --- a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression.kt.after +++ b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNot{}.mapIndexed{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .filterNot { it.isBlank() } - .mapIndexed { index, s -> s.length * index } - .firstOrNull { it > 0 } + .filterNot { it.isBlank() } + .mapIndexed { index, s -> s.length * index } + .firstOrNull { it > 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression.kt.after2 b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression.kt.after2 index 4eeae1e3ccb..84ad1a1b175 100644 --- a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNot{}.mapIndexed{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .asSequence() - .filterNot { it.isBlank() } - .mapIndexed { index, s -> s.length * index } - .firstOrNull { it > 0 } + .asSequence() + .filterNot { it.isBlank() } + .mapIndexed { index, s -> s.length * index } + .firstOrNull { it > 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedAfterIncrement.kt.after b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedAfterIncrement.kt.after index 723ec3b88b0..9de51388002 100644 --- a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedAfterIncrement.kt.after +++ b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedAfterIncrement.kt.after @@ -5,7 +5,7 @@ fun foo(list: List): Int? { var index = 0 return list - .filterNot { it.isBlank() } - .map { it.length * index++ } - .firstOrNull { it * 100 > index * index } + .filterNot { it.isBlank() } + .map { it.length * index++ } + .firstOrNull { it * 100 > index * index } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedAfterIncrement.kt.after2 b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedAfterIncrement.kt.after2 index 590cadbaca8..6ef866bafb4 100644 --- a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedAfterIncrement.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedAfterIncrement.kt.after2 @@ -5,8 +5,8 @@ fun foo(list: List): Int? { var index = 0 return list - .asSequence() - .filterNot { it.isBlank() } - .map { it.length * index++ } - .firstOrNull { it * 100 > index * index } + .asSequence() + .filterNot { it.isBlank() } + .map { it.length * index++ } + .firstOrNull { it * 100 > index * index } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedBeforeIncrement.kt.after b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedBeforeIncrement.kt.after index 456013faced..93789d35ef4 100644 --- a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedBeforeIncrement.kt.after +++ b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedBeforeIncrement.kt.after @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence()...mapIndexed{}.mapIndexed{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .filterNot { it.isBlank() } - .mapIndexed { index, s -> s.length * index } - .mapIndexed { index, x -> x * index } - .firstOrNull { it > 1000 } + .filterNot { it.isBlank() } + .mapIndexed { index, s -> s.length * index } + .mapIndexed { index, x -> x * index } + .firstOrNull { it > 1000 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedBeforeIncrement.kt.after2 b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedBeforeIncrement.kt.after2 index d94f859da9d..a56bae69d5d 100644 --- a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedBeforeIncrement.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedBeforeIncrement.kt.after2 @@ -3,9 +3,9 @@ // INTENTION_TEXT_2: "Replace with 'asSequence()...mapIndexed{}.mapIndexed{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .asSequence() - .filterNot { it.isBlank() } - .mapIndexed { index, s -> s.length * index } - .mapIndexed { index, x -> x * index } - .firstOrNull { it > 1000 } + .asSequence() + .filterNot { it.isBlank() } + .mapIndexed { index, s -> s.length * index } + .mapIndexed { index, x -> x * index } + .firstOrNull { it > 1000 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedBeforeIncrement2.kt.after b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedBeforeIncrement2.kt.after index ebdca2bbd22..d5782ae46ea 100644 --- a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedBeforeIncrement2.kt.after +++ b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedBeforeIncrement2.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.mapIndexed{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .mapIndexed { index, s -> s.length * index } - .mapIndexed { index, x -> x * index } - .firstOrNull { it <= 1000 } + .mapIndexed { index, s -> s.length * index } + .mapIndexed { index, x -> x * index } + .firstOrNull { it <= 1000 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedBeforeIncrement2.kt.after2 b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedBeforeIncrement2.kt.after2 index a6446cb17b1..f52625bee0f 100644 --- a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedBeforeIncrement2.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusInsideExpression_indexUsedBeforeIncrement2.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.mapIndexed{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .asSequence() - .mapIndexed { index, s -> s.length * index } - .mapIndexed { index, x -> x * index } - .firstOrNull { it <= 1000 } + .asSequence() + .mapIndexed { index, s -> s.length * index } + .mapIndexed { index, x -> x * index } + .firstOrNull { it <= 1000 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusIsNotLastStatement.kt.after b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusIsNotLastStatement.kt.after index 29afe43e596..8a11065ab26 100644 --- a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusIsNotLastStatement.kt.after +++ b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusIsNotLastStatement.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNot{}.mapIndexed{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .filterNot { it.isBlank() } - .mapIndexed { index, s -> s.length * index } - .firstOrNull { it > 0 } + .filterNot { it.isBlank() } + .mapIndexed { index, s -> s.length * index } + .firstOrNull { it > 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusIsNotLastStatement.kt.after2 b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusIsNotLastStatement.kt.after2 index 4eeae1e3ccb..84ad1a1b175 100644 --- a/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusIsNotLastStatement.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusIsNotLastStatement.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNot{}.mapIndexed{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .asSequence() - .filterNot { it.isBlank() } - .mapIndexed { index, s -> s.length * index } - .firstOrNull { it > 0 } + .asSequence() + .filterNot { it.isBlank() } + .mapIndexed { index, s -> s.length * index } + .firstOrNull { it > 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/introduceIndex/indexWithNestedLoop.kt.after b/idea/testData/intentions/loopToCallChain/introduceIndex/indexWithNestedLoop.kt.after index 1579e35e665..28607bd331f 100644 --- a/idea/testData/intentions/loopToCallChain/introduceIndex/indexWithNestedLoop.kt.after +++ b/idea/testData/intentions/loopToCallChain/introduceIndex/indexWithNestedLoop.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().flatMap{}.filter{}.mapIndexedTo(){}'" fun foo(list: List, target: MutableCollection) { list - .flatMap { it.indices } - .filter { it != 10 } - .mapIndexedTo(target) { i, j -> i + j } + .flatMap { it.indices } + .filter { it != 10 } + .mapIndexedTo(target) { i, j -> i + j } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/introduceIndex/indexWithNestedLoop.kt.after2 b/idea/testData/intentions/loopToCallChain/introduceIndex/indexWithNestedLoop.kt.after2 index 1be56318c10..7322dd0870b 100644 --- a/idea/testData/intentions/loopToCallChain/introduceIndex/indexWithNestedLoop.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/introduceIndex/indexWithNestedLoop.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().flatMap{}.filter{}.mapIndexedTo(){}'" fun foo(list: List, target: MutableCollection) { list - .asSequence() - .flatMap { it.indices.asSequence() } - .filter { it != 10 } - .mapIndexedTo(target) { i, j -> i + j } + .asSequence() + .flatMap { it.indices.asSequence() } + .filter { it != 10 } + .mapIndexedTo(target) { i, j -> i + j } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/introduceIndex/prefixIndexPlusPlusInsideExpression.kt.after b/idea/testData/intentions/loopToCallChain/introduceIndex/prefixIndexPlusPlusInsideExpression.kt.after index cf8b3c0e2ee..9ff6a313a84 100644 --- a/idea/testData/intentions/loopToCallChain/introduceIndex/prefixIndexPlusPlusInsideExpression.kt.after +++ b/idea/testData/intentions/loopToCallChain/introduceIndex/prefixIndexPlusPlusInsideExpression.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNot{}.mapIndexed{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .filterNot { it.isBlank() } - .mapIndexed { index, s -> s.length * (index + 1) } - .firstOrNull { it > 0 } + .filterNot { it.isBlank() } + .mapIndexed { index, s -> s.length * (index + 1) } + .firstOrNull { it > 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/introduceIndex/prefixIndexPlusPlusInsideExpression.kt.after2 b/idea/testData/intentions/loopToCallChain/introduceIndex/prefixIndexPlusPlusInsideExpression.kt.after2 index 851616d0c11..d3bd3b5b446 100644 --- a/idea/testData/intentions/loopToCallChain/introduceIndex/prefixIndexPlusPlusInsideExpression.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/introduceIndex/prefixIndexPlusPlusInsideExpression.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNot{}.mapIndexed{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .asSequence() - .filterNot { it.isBlank() } - .mapIndexed { index, s -> s.length * (index + 1) } - .firstOrNull { it > 0 } + .asSequence() + .filterNot { it.isBlank() } + .mapIndexed { index, s -> s.length * (index + 1) } + .firstOrNull { it > 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/assignMap.kt.after b/idea/testData/intentions/loopToCallChain/map/assignMap.kt.after index 05821dfce21..7a48353c88b 100644 --- a/idea/testData/intentions/loopToCallChain/map/assignMap.kt.after +++ b/idea/testData/intentions/loopToCallChain/map/assignMap.kt.after @@ -5,7 +5,7 @@ import java.util.ArrayList fun foo(list: List): List { val result = list - .filter { it.length > 0 } - .map { it.hashCode() } + .filter { it.length > 0 } + .map { it.hashCode() } return result } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/assignMap.kt.after2 b/idea/testData/intentions/loopToCallChain/map/assignMap.kt.after2 index 23b4af882f1..4964b0eea8b 100644 --- a/idea/testData/intentions/loopToCallChain/map/assignMap.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/map/assignMap.kt.after2 @@ -5,9 +5,9 @@ import java.util.ArrayList fun foo(list: List): List { val result = list - .asSequence() - .filter { it.length > 0 } - .map { it.hashCode() } - .toList() + .asSequence() + .filter { it.length > 0 } + .map { it.hashCode() } + .toList() return result } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/assignMap2.kt.after b/idea/testData/intentions/loopToCallChain/map/assignMap2.kt.after index c3db82ff5be..0c34a2dc3eb 100644 --- a/idea/testData/intentions/loopToCallChain/map/assignMap2.kt.after +++ b/idea/testData/intentions/loopToCallChain/map/assignMap2.kt.after @@ -5,7 +5,7 @@ import java.util.ArrayList fun foo(list: List): List { val result = list - .filter { it.length > 0 } - .map { it.hashCode() } + .filter { it.length > 0 } + .map { it.hashCode() } return result } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/assignMap2.kt.after2 b/idea/testData/intentions/loopToCallChain/map/assignMap2.kt.after2 index e0f5ac22a09..f8f7e262d19 100644 --- a/idea/testData/intentions/loopToCallChain/map/assignMap2.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/map/assignMap2.kt.after2 @@ -5,9 +5,9 @@ import java.util.ArrayList fun foo(list: List): List { val result = list - .asSequence() - .filter { it.length > 0 } - .map { it.hashCode() } - .toList() + .asSequence() + .filter { it.length > 0 } + .map { it.hashCode() } + .toList() return result } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/map.kt.after b/idea/testData/intentions/loopToCallChain/map/map.kt.after index 850c6d9f602..537187a7455 100644 --- a/idea/testData/intentions/loopToCallChain/map/map.kt.after +++ b/idea/testData/intentions/loopToCallChain/map/map.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .map { it.length } - .firstOrNull { it > 0 } + .map { it.length } + .firstOrNull { it > 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/map.kt.after2 b/idea/testData/intentions/loopToCallChain/map/map.kt.after2 index 67600762ba4..a7fc7239e2d 100644 --- a/idea/testData/intentions/loopToCallChain/map/map.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/map/map.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .asSequence() - .map { it.length } - .firstOrNull { it > 0 } + .asSequence() + .map { it.length } + .firstOrNull { it > 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapAndFilterIndexed.kt.after b/idea/testData/intentions/loopToCallChain/map/mapAndFilterIndexed.kt.after index ef4cee53532..6cac86d00e2 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapAndFilterIndexed.kt.after +++ b/idea/testData/intentions/loopToCallChain/map/mapAndFilterIndexed.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.filterIndexed{}.firstOrNull()'" fun foo(list: List): Int? { return list - .map { it.length } - .filterIndexed { index, l -> l > index } - .firstOrNull() + .map { it.length } + .filterIndexed { index, l -> l > index } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapAndFilterIndexed.kt.after2 b/idea/testData/intentions/loopToCallChain/map/mapAndFilterIndexed.kt.after2 index b2b94e60e1e..c92a3f9f4ac 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapAndFilterIndexed.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/map/mapAndFilterIndexed.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.filterIndexed{}.firstOrNull()'" fun foo(list: List): Int? { return list - .asSequence() - .map { it.length } - .filterIndexed { index, l -> l > index } - .firstOrNull() + .asSequence() + .map { it.length } + .filterIndexed { index, l -> l > index } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapIndexed.kt.after b/idea/testData/intentions/loopToCallChain/map/mapIndexed.kt.after index 2aba8f742e4..017ac769332 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapIndexed.kt.after +++ b/idea/testData/intentions/loopToCallChain/map/mapIndexed.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .mapIndexed { index, s -> s.length * index } - .firstOrNull { it > 0 } + .mapIndexed { index, s -> s.length * index } + .firstOrNull { it > 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapIndexed.kt.after2 b/idea/testData/intentions/loopToCallChain/map/mapIndexed.kt.after2 index d0a8ce46781..fe80d809a85 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapIndexed.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/map/mapIndexed.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .asSequence() - .mapIndexed { index, s -> s.length * index } - .firstOrNull { it > 0 } + .asSequence() + .mapIndexed { index, s -> s.length * index } + .firstOrNull { it > 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapIndexedNotNull.kt.after b/idea/testData/intentions/loopToCallChain/map/mapIndexedNotNull.kt.after index 5454bb15f5e..bfd439ea754 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapIndexedNotNull.kt.after +++ b/idea/testData/intentions/loopToCallChain/map/mapIndexedNotNull.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexedNotNull{}.mapTo(){}'" fun foo(list: List, target: MutableList) { list - .mapIndexedNotNull { index, s -> s?.substring(index)?.length } - .mapTo(target) { it.toString() } + .mapIndexedNotNull { index, s -> s?.substring(index)?.length } + .mapTo(target) { it.toString() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapIndexedNotNull.kt.after2 b/idea/testData/intentions/loopToCallChain/map/mapIndexedNotNull.kt.after2 index ba598210979..7cc7f2eee31 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapIndexedNotNull.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/map/mapIndexedNotNull.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexedNotNull{}.mapTo(){}'" fun foo(list: List, target: MutableList) { list - .asSequence() - .mapIndexedNotNull { index, s -> s?.substring(index)?.length } - .mapTo(target) { it.toString() } + .asSequence() + .mapIndexedNotNull { index, s -> s?.substring(index)?.length } + .mapTo(target) { it.toString() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapIndexedNotNull_elvisContinue.kt.after b/idea/testData/intentions/loopToCallChain/map/mapIndexedNotNull_elvisContinue.kt.after index 5454bb15f5e..bfd439ea754 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapIndexedNotNull_elvisContinue.kt.after +++ b/idea/testData/intentions/loopToCallChain/map/mapIndexedNotNull_elvisContinue.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexedNotNull{}.mapTo(){}'" fun foo(list: List, target: MutableList) { list - .mapIndexedNotNull { index, s -> s?.substring(index)?.length } - .mapTo(target) { it.toString() } + .mapIndexedNotNull { index, s -> s?.substring(index)?.length } + .mapTo(target) { it.toString() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapIndexedNotNull_elvisContinue.kt.after2 b/idea/testData/intentions/loopToCallChain/map/mapIndexedNotNull_elvisContinue.kt.after2 index ba598210979..7cc7f2eee31 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapIndexedNotNull_elvisContinue.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/map/mapIndexedNotNull_elvisContinue.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexedNotNull{}.mapTo(){}'" fun foo(list: List, target: MutableList) { list - .asSequence() - .mapIndexedNotNull { index, s -> s?.substring(index)?.length } - .mapTo(target) { it.toString() } + .asSequence() + .mapIndexedNotNull { index, s -> s?.substring(index)?.length } + .mapTo(target) { it.toString() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapIndexed_afterFilter.kt.after b/idea/testData/intentions/loopToCallChain/map/mapIndexed_afterFilter.kt.after index a5badd2c248..30674ab7292 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapIndexed_afterFilter.kt.after +++ b/idea/testData/intentions/loopToCallChain/map/mapIndexed_afterFilter.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNot{}.mapIndexed{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .filterNot { it.isBlank() } - .mapIndexed { index, s -> s.length * index } - .firstOrNull { it > 0 } + .filterNot { it.isBlank() } + .mapIndexed { index, s -> s.length * index } + .firstOrNull { it > 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapIndexed_afterFilter.kt.after2 b/idea/testData/intentions/loopToCallChain/map/mapIndexed_afterFilter.kt.after2 index 341dcdafa77..76cb9e50ce5 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapIndexed_afterFilter.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/map/mapIndexed_afterFilter.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNot{}.mapIndexed{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .asSequence() - .filterNot { it.isBlank() } - .mapIndexed { index, s -> s.length * index } - .firstOrNull { it > 0 } + .asSequence() + .filterNot { it.isBlank() } + .mapIndexed { index, s -> s.length * index } + .firstOrNull { it > 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapIndexed_twice.kt.after b/idea/testData/intentions/loopToCallChain/map/mapIndexed_twice.kt.after index 8ea4f69ddb1..187eb5cb7b1 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapIndexed_twice.kt.after +++ b/idea/testData/intentions/loopToCallChain/map/mapIndexed_twice.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.mapIndexed{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .mapIndexed { index, s -> s.length * index } - .mapIndexed { index, x -> x + index } - .firstOrNull { it > 0 } + .mapIndexed { index, s -> s.length * index } + .mapIndexed { index, x -> x + index } + .firstOrNull { it > 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapIndexed_twice.kt.after2 b/idea/testData/intentions/loopToCallChain/map/mapIndexed_twice.kt.after2 index 6d9194606f9..a62c832739e 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapIndexed_twice.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/map/mapIndexed_twice.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.mapIndexed{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .asSequence() - .mapIndexed { index, s -> s.length * index } - .mapIndexed { index, x -> x + index } - .firstOrNull { it > 0 } + .asSequence() + .mapIndexed { index, s -> s.length * index } + .mapIndexed { index, x -> x + index } + .firstOrNull { it > 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapNotNull.kt.after b/idea/testData/intentions/loopToCallChain/map/mapNotNull.kt.after index 831860de7ff..e889a143d3c 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapNotNull.kt.after +++ b/idea/testData/intentions/loopToCallChain/map/mapNotNull.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapNotNull{}.mapTo(){}'" fun foo(list: List, target: MutableList) { list - .mapNotNull { it?.length } - .mapTo(target) { it.toString() } + .mapNotNull { it?.length } + .mapTo(target) { it.toString() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapNotNull.kt.after2 b/idea/testData/intentions/loopToCallChain/map/mapNotNull.kt.after2 index 574a2fe7671..bef5d660127 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapNotNull.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/map/mapNotNull.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapNotNull{}.mapTo(){}'" fun foo(list: List, target: MutableList) { list - .asSequence() - .mapNotNull { it?.length } - .mapTo(target) { it.toString() } + .asSequence() + .mapNotNull { it?.length } + .mapTo(target) { it.toString() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapNotNull_elvisContinue.kt.after b/idea/testData/intentions/loopToCallChain/map/mapNotNull_elvisContinue.kt.after index 831860de7ff..e889a143d3c 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapNotNull_elvisContinue.kt.after +++ b/idea/testData/intentions/loopToCallChain/map/mapNotNull_elvisContinue.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapNotNull{}.mapTo(){}'" fun foo(list: List, target: MutableList) { list - .mapNotNull { it?.length } - .mapTo(target) { it.toString() } + .mapNotNull { it?.length } + .mapTo(target) { it.toString() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapNotNull_elvisContinue.kt.after2 b/idea/testData/intentions/loopToCallChain/map/mapNotNull_elvisContinue.kt.after2 index 574a2fe7671..bef5d660127 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapNotNull_elvisContinue.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/map/mapNotNull_elvisContinue.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapNotNull{}.mapTo(){}'" fun foo(list: List, target: MutableList) { list - .asSequence() - .mapNotNull { it?.length } - .mapTo(target) { it.toString() } + .asSequence() + .mapNotNull { it?.length } + .mapTo(target) { it.toString() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapNotNull_nestedLoopElvisContinue.kt.after b/idea/testData/intentions/loopToCallChain/map/mapNotNull_nestedLoopElvisContinue.kt.after index ef5502e2439..42ed025db55 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapNotNull_nestedLoopElvisContinue.kt.after +++ b/idea/testData/intentions/loopToCallChain/map/mapNotNull_nestedLoopElvisContinue.kt.after @@ -3,9 +3,9 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().flatMap{}.mapNotNull{}.mapTo(){}'" fun foo(list: List, target: MutableList) { list - .flatMap { it.indices } - .mapNotNull { bar(it) } - .mapTo(target) { it.substring(1) } + .flatMap { it.indices } + .mapNotNull { bar(it) } + .mapTo(target) { it.substring(1) } } fun bar(p: Int): String? = null \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapNotNull_nestedLoopElvisContinue.kt.after2 b/idea/testData/intentions/loopToCallChain/map/mapNotNull_nestedLoopElvisContinue.kt.after2 index c2fb0f0008e..574acf1ba63 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapNotNull_nestedLoopElvisContinue.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/map/mapNotNull_nestedLoopElvisContinue.kt.after2 @@ -3,10 +3,10 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().flatMap{}.mapNotNull{}.mapTo(){}'" fun foo(list: List, target: MutableList) { list - .asSequence() - .flatMap { it.indices.asSequence() } - .mapNotNull { bar(it) } - .mapTo(target) { it.substring(1) } + .asSequence() + .flatMap { it.indices.asSequence() } + .mapNotNull { bar(it) } + .mapTo(target) { it.substring(1) } } fun bar(p: Int): String? = null \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapTo.kt.after b/idea/testData/intentions/loopToCallChain/map/mapTo.kt.after index 87c469b2ca3..fea6c7e700f 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapTo.kt.after +++ b/idea/testData/intentions/loopToCallChain/map/mapTo.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.mapTo(){}'" fun foo(list: List, target: MutableList) { list - .filter { it.length > 0 } - .mapTo(target) { it.hashCode() } + .filter { it.length > 0 } + .mapTo(target) { it.hashCode() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapTo.kt.after2 b/idea/testData/intentions/loopToCallChain/map/mapTo.kt.after2 index d327711d3a5..c76483e56cf 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapTo.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/map/mapTo.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.mapTo(){}'" fun foo(list: List, target: MutableList) { list - .asSequence() - .filter { it.length > 0 } - .mapTo(target) { it.hashCode() } + .asSequence() + .filter { it.length > 0 } + .mapTo(target) { it.hashCode() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapTo3.kt.after b/idea/testData/intentions/loopToCallChain/map/mapTo3.kt.after index 5b7091e3ee9..c45c04738ac 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapTo3.kt.after +++ b/idea/testData/intentions/loopToCallChain/map/mapTo3.kt.after @@ -5,7 +5,7 @@ import java.util.ArrayList fun foo(list: List): List { val target = list - .filter { it.length > 0 } - .mapTo(ArrayList(100)) { it.hashCode() } + .filter { it.length > 0 } + .mapTo(ArrayList(100)) { it.hashCode() } return target } diff --git a/idea/testData/intentions/loopToCallChain/map/mapTo3.kt.after2 b/idea/testData/intentions/loopToCallChain/map/mapTo3.kt.after2 index 41c4ff94f08..8a64f7412a9 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapTo3.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/map/mapTo3.kt.after2 @@ -5,8 +5,8 @@ import java.util.ArrayList fun foo(list: List): List { val target = list - .asSequence() - .filter { it.length > 0 } - .mapTo(ArrayList(100)) { it.hashCode() } + .asSequence() + .filter { it.length > 0 } + .mapTo(ArrayList(100)) { it.hashCode() } return target } diff --git a/idea/testData/intentions/loopToCallChain/map/mapTo4.kt.after b/idea/testData/intentions/loopToCallChain/map/mapTo4.kt.after index fb969828375..a76aff9bc5b 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapTo4.kt.after +++ b/idea/testData/intentions/loopToCallChain/map/mapTo4.kt.after @@ -4,8 +4,8 @@ fun foo(list: List): List { val target = createCollection() list - .filter { it.length > 0 } - .mapTo(target) { it.hashCode() } + .filter { it.length > 0 } + .mapTo(target) { it.hashCode() } return target } diff --git a/idea/testData/intentions/loopToCallChain/map/mapTo4.kt.after2 b/idea/testData/intentions/loopToCallChain/map/mapTo4.kt.after2 index b4230db74d6..35f41a490fd 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapTo4.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/map/mapTo4.kt.after2 @@ -4,9 +4,9 @@ fun foo(list: List): List { val target = createCollection() list - .asSequence() - .filter { it.length > 0 } - .mapTo(target) { it.hashCode() } + .asSequence() + .filter { it.length > 0 } + .mapTo(target) { it.hashCode() } return target } diff --git a/idea/testData/intentions/loopToCallChain/map/mapTo_inputVarNotUsed.kt.after b/idea/testData/intentions/loopToCallChain/map/mapTo_inputVarNotUsed.kt.after index a4b0c672c8e..ec3f17df1cb 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapTo_inputVarNotUsed.kt.after +++ b/idea/testData/intentions/loopToCallChain/map/mapTo_inputVarNotUsed.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.forEach{}'" fun foo(list: List, target: MutableList) { list - .filter { it.length > 0 } - .forEach { target.add(0) } + .filter { it.length > 0 } + .forEach { target.add(0) } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapTo_inputVarNotUsed.kt.after2 b/idea/testData/intentions/loopToCallChain/map/mapTo_inputVarNotUsed.kt.after2 index adbcd7db504..fecb3d839c1 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapTo_inputVarNotUsed.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/map/mapTo_inputVarNotUsed.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.forEach{}'" fun foo(list: List, target: MutableList) { list - .asSequence() - .filter { it.length > 0 } - .forEach { target.add(0) } + .asSequence() + .filter { it.length > 0 } + .forEach { target.add(0) } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapVar.kt.after b/idea/testData/intentions/loopToCallChain/map/mapVar.kt.after index 850c6d9f602..537187a7455 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapVar.kt.after +++ b/idea/testData/intentions/loopToCallChain/map/mapVar.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .map { it.length } - .firstOrNull { it > 0 } + .map { it.length } + .firstOrNull { it > 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/map/mapVar.kt.after2 b/idea/testData/intentions/loopToCallChain/map/mapVar.kt.after2 index 67600762ba4..a7fc7239e2d 100644 --- a/idea/testData/intentions/loopToCallChain/map/mapVar.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/map/mapVar.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.firstOrNull{}'" fun foo(list: List): Int? { return list - .asSequence() - .map { it.length } - .firstOrNull { it > 0 } + .asSequence() + .map { it.length } + .firstOrNull { it > 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/maxMin/KT14210.kt.after b/idea/testData/intentions/loopToCallChain/maxMin/KT14210.kt.after index 20c5e32d6d6..0762403e3a0 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/KT14210.kt.after +++ b/idea/testData/intentions/loopToCallChain/maxMin/KT14210.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.max()'" fun f(list: List) { val result = list - .filter { it % 2 == 0 } - .max() - ?: -1 + .filter { it % 2 == 0 } + .max() + ?: -1 } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/maxMin/KT14210.kt.after2 b/idea/testData/intentions/loopToCallChain/maxMin/KT14210.kt.after2 index 1c3db9b7e12..a19476ea394 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/KT14210.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/maxMin/KT14210.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.max()'" fun f(list: List) { val result = list - .asSequence() - .filter { it % 2 == 0 } - .max() - ?: -1 + .asSequence() + .filter { it % 2 == 0 } + .max() + ?: -1 } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/maxMin/max1.kt.after b/idea/testData/intentions/loopToCallChain/maxMin/max1.kt.after index 47fb2b03f6d..a77fa2ad82f 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/max1.kt.after +++ b/idea/testData/intentions/loopToCallChain/maxMin/max1.kt.after @@ -3,9 +3,9 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'" fun getMaxLineWidth(lineCount: Int): Float { val max_width = (0..lineCount - 1) - .map { getLineWidth(it) } - .max() - ?: 0.0f + .map { getLineWidth(it) } + .max() + ?: 0.0f return max_width } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/max1.kt.after2 b/idea/testData/intentions/loopToCallChain/maxMin/max1.kt.after2 index 8411a195010..a99b31b10ea 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/max1.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/maxMin/max1.kt.after2 @@ -3,10 +3,10 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'" fun getMaxLineWidth(lineCount: Int): Float { val max_width = (0..lineCount - 1) - .asSequence() - .map { getLineWidth(it) } - .max() - ?: 0.0f + .asSequence() + .map { getLineWidth(it) } + .max() + ?: 0.0f return max_width } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/max2.kt.after b/idea/testData/intentions/loopToCallChain/maxMin/max2.kt.after index 47fb2b03f6d..a77fa2ad82f 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/max2.kt.after +++ b/idea/testData/intentions/loopToCallChain/maxMin/max2.kt.after @@ -3,9 +3,9 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'" fun getMaxLineWidth(lineCount: Int): Float { val max_width = (0..lineCount - 1) - .map { getLineWidth(it) } - .max() - ?: 0.0f + .map { getLineWidth(it) } + .max() + ?: 0.0f return max_width } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/max2.kt.after2 b/idea/testData/intentions/loopToCallChain/maxMin/max2.kt.after2 index 8411a195010..a99b31b10ea 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/max2.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/maxMin/max2.kt.after2 @@ -3,10 +3,10 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'" fun getMaxLineWidth(lineCount: Int): Float { val max_width = (0..lineCount - 1) - .asSequence() - .map { getLineWidth(it) } - .max() - ?: 0.0f + .asSequence() + .map { getLineWidth(it) } + .max() + ?: 0.0f return max_width } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/max3.kt.after b/idea/testData/intentions/loopToCallChain/maxMin/max3.kt.after index 47fb2b03f6d..a77fa2ad82f 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/max3.kt.after +++ b/idea/testData/intentions/loopToCallChain/maxMin/max3.kt.after @@ -3,9 +3,9 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'" fun getMaxLineWidth(lineCount: Int): Float { val max_width = (0..lineCount - 1) - .map { getLineWidth(it) } - .max() - ?: 0.0f + .map { getLineWidth(it) } + .max() + ?: 0.0f return max_width } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/max3.kt.after2 b/idea/testData/intentions/loopToCallChain/maxMin/max3.kt.after2 index 8411a195010..a99b31b10ea 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/max3.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/maxMin/max3.kt.after2 @@ -3,10 +3,10 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'" fun getMaxLineWidth(lineCount: Int): Float { val max_width = (0..lineCount - 1) - .asSequence() - .map { getLineWidth(it) } - .max() - ?: 0.0f + .asSequence() + .map { getLineWidth(it) } + .max() + ?: 0.0f return max_width } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/max4.kt.after b/idea/testData/intentions/loopToCallChain/maxMin/max4.kt.after index 92f46598674..c364c2ccc6c 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/max4.kt.after +++ b/idea/testData/intentions/loopToCallChain/maxMin/max4.kt.after @@ -3,6 +3,6 @@ // IS_APPLICABLE_2: false fun getMaxLineWidth(list: List): Float { val max = list.max() - ?: 0.0f + ?: 0.0f return max } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/max5.kt.after b/idea/testData/intentions/loopToCallChain/maxMin/max5.kt.after index 75d3d4da511..3cf93eeb1f0 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/max5.kt.after +++ b/idea/testData/intentions/loopToCallChain/maxMin/max5.kt.after @@ -3,9 +3,9 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'" fun getMaxLineWidth(count: Int): Double { val max = (0..count-1) - .map { getLineWidth(it) } - .max() - ?: 0.0 + .map { getLineWidth(it) } + .max() + ?: 0.0 return max } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/max5.kt.after2 b/idea/testData/intentions/loopToCallChain/maxMin/max5.kt.after2 index c60e7680fe9..0e1a0a0503a 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/max5.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/maxMin/max5.kt.after2 @@ -3,10 +3,10 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'" fun getMaxLineWidth(count: Int): Double { val max = (0..count-1) - .asSequence() - .map { getLineWidth(it) } - .max() - ?: 0.0 + .asSequence() + .map { getLineWidth(it) } + .max() + ?: 0.0 return max } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/max6.kt.after b/idea/testData/intentions/loopToCallChain/maxMin/max6.kt.after index 1e536219e18..42722097694 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/max6.kt.after +++ b/idea/testData/intentions/loopToCallChain/maxMin/max6.kt.after @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.max()'" fun getMaxLineWidth(list: List): Double { val max = list - .mapIndexed { i, item -> item * i } - .max() - ?: 0.0 + .mapIndexed { i, item -> item * i } + .max() + ?: 0.0 return max } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/max6.kt.after2 b/idea/testData/intentions/loopToCallChain/maxMin/max6.kt.after2 index f96775edf36..f22ecd7e3f0 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/max6.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/maxMin/max6.kt.after2 @@ -3,9 +3,9 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.max()'" fun getMaxLineWidth(list: List): Double { val max = list - .asSequence() - .mapIndexed { i, item -> item * i } - .max() - ?: 0.0 + .asSequence() + .mapIndexed { i, item -> item * i } + .max() + ?: 0.0 return max } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/max7.kt.after b/idea/testData/intentions/loopToCallChain/maxMin/max7.kt.after index 0e8d03769e8..3fef9ca989a 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/max7.kt.after +++ b/idea/testData/intentions/loopToCallChain/maxMin/max7.kt.after @@ -5,9 +5,9 @@ import java.lang.Math.max fun getMaxLineWidth(count: Int): Double { val m = (0..count-1) - .map { getLineWidth(it) } - .max() - ?: 0.0 + .map { getLineWidth(it) } + .max() + ?: 0.0 return m } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/max7.kt.after2 b/idea/testData/intentions/loopToCallChain/maxMin/max7.kt.after2 index f593ce9d763..39056ec15dd 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/max7.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/maxMin/max7.kt.after2 @@ -5,10 +5,10 @@ import java.lang.Math.max fun getMaxLineWidth(count: Int): Double { val m = (0..count-1) - .asSequence() - .map { getLineWidth(it) } - .max() - ?: 0.0 + .asSequence() + .map { getLineWidth(it) } + .max() + ?: 0.0 return m } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/min1.kt.after b/idea/testData/intentions/loopToCallChain/maxMin/min1.kt.after index de805321864..24cf4e3ee72 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/min1.kt.after +++ b/idea/testData/intentions/loopToCallChain/maxMin/min1.kt.after @@ -3,9 +3,9 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'" fun getMinLineWidth(lineCount: Int): Double { val min_width = (0..lineCount - 1) - .map { getLineWidth(it) } - .min() - ?: Double.MAX_VALUE + .map { getLineWidth(it) } + .min() + ?: Double.MAX_VALUE return min_width } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/min1.kt.after2 b/idea/testData/intentions/loopToCallChain/maxMin/min1.kt.after2 index 2d1336352cb..196b6c13a67 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/min1.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/maxMin/min1.kt.after2 @@ -3,10 +3,10 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'" fun getMinLineWidth(lineCount: Int): Double { val min_width = (0..lineCount - 1) - .asSequence() - .map { getLineWidth(it) } - .min() - ?: Double.MAX_VALUE + .asSequence() + .map { getLineWidth(it) } + .min() + ?: Double.MAX_VALUE return min_width } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/min2.kt.after b/idea/testData/intentions/loopToCallChain/maxMin/min2.kt.after index de805321864..24cf4e3ee72 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/min2.kt.after +++ b/idea/testData/intentions/loopToCallChain/maxMin/min2.kt.after @@ -3,9 +3,9 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'" fun getMinLineWidth(lineCount: Int): Double { val min_width = (0..lineCount - 1) - .map { getLineWidth(it) } - .min() - ?: Double.MAX_VALUE + .map { getLineWidth(it) } + .min() + ?: Double.MAX_VALUE return min_width } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/min2.kt.after2 b/idea/testData/intentions/loopToCallChain/maxMin/min2.kt.after2 index 2d1336352cb..196b6c13a67 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/min2.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/maxMin/min2.kt.after2 @@ -3,10 +3,10 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'" fun getMinLineWidth(lineCount: Int): Double { val min_width = (0..lineCount - 1) - .asSequence() - .map { getLineWidth(it) } - .min() - ?: Double.MAX_VALUE + .asSequence() + .map { getLineWidth(it) } + .min() + ?: Double.MAX_VALUE return min_width } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/min3.kt.after b/idea/testData/intentions/loopToCallChain/maxMin/min3.kt.after index de805321864..24cf4e3ee72 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/min3.kt.after +++ b/idea/testData/intentions/loopToCallChain/maxMin/min3.kt.after @@ -3,9 +3,9 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'" fun getMinLineWidth(lineCount: Int): Double { val min_width = (0..lineCount - 1) - .map { getLineWidth(it) } - .min() - ?: Double.MAX_VALUE + .map { getLineWidth(it) } + .min() + ?: Double.MAX_VALUE return min_width } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/min3.kt.after2 b/idea/testData/intentions/loopToCallChain/maxMin/min3.kt.after2 index 2d1336352cb..196b6c13a67 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/min3.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/maxMin/min3.kt.after2 @@ -3,10 +3,10 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'" fun getMinLineWidth(lineCount: Int): Double { val min_width = (0..lineCount - 1) - .asSequence() - .map { getLineWidth(it) } - .min() - ?: Double.MAX_VALUE + .asSequence() + .map { getLineWidth(it) } + .min() + ?: Double.MAX_VALUE return min_width } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/min4.kt.after b/idea/testData/intentions/loopToCallChain/maxMin/min4.kt.after index de805321864..24cf4e3ee72 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/min4.kt.after +++ b/idea/testData/intentions/loopToCallChain/maxMin/min4.kt.after @@ -3,9 +3,9 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'" fun getMinLineWidth(lineCount: Int): Double { val min_width = (0..lineCount - 1) - .map { getLineWidth(it) } - .min() - ?: Double.MAX_VALUE + .map { getLineWidth(it) } + .min() + ?: Double.MAX_VALUE return min_width } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/min4.kt.after2 b/idea/testData/intentions/loopToCallChain/maxMin/min4.kt.after2 index 2d1336352cb..196b6c13a67 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/min4.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/maxMin/min4.kt.after2 @@ -3,10 +3,10 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'" fun getMinLineWidth(lineCount: Int): Double { val min_width = (0..lineCount - 1) - .asSequence() - .map { getLineWidth(it) } - .min() - ?: Double.MAX_VALUE + .asSequence() + .map { getLineWidth(it) } + .min() + ?: Double.MAX_VALUE return min_width } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/min5.kt.after b/idea/testData/intentions/loopToCallChain/maxMin/min5.kt.after index de805321864..24cf4e3ee72 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/min5.kt.after +++ b/idea/testData/intentions/loopToCallChain/maxMin/min5.kt.after @@ -3,9 +3,9 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'" fun getMinLineWidth(lineCount: Int): Double { val min_width = (0..lineCount - 1) - .map { getLineWidth(it) } - .min() - ?: Double.MAX_VALUE + .map { getLineWidth(it) } + .min() + ?: Double.MAX_VALUE return min_width } diff --git a/idea/testData/intentions/loopToCallChain/maxMin/min5.kt.after2 b/idea/testData/intentions/loopToCallChain/maxMin/min5.kt.after2 index 2d1336352cb..196b6c13a67 100644 --- a/idea/testData/intentions/loopToCallChain/maxMin/min5.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/maxMin/min5.kt.after2 @@ -3,10 +3,10 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'" fun getMinLineWidth(lineCount: Int): Double { val min_width = (0..lineCount - 1) - .asSequence() - .map { getLineWidth(it) } - .min() - ?: Double.MAX_VALUE + .asSequence() + .map { getLineWidth(it) } + .min() + ?: Double.MAX_VALUE return min_width } diff --git a/idea/testData/intentions/loopToCallChain/smartCasts/errorOutsideLoop.kt.after b/idea/testData/intentions/loopToCallChain/smartCasts/errorOutsideLoop.kt.after index 47dd671a90d..ccc01d9a1ee 100644 --- a/idea/testData/intentions/loopToCallChain/smartCasts/errorOutsideLoop.kt.after +++ b/idea/testData/intentions/loopToCallChain/smartCasts/errorOutsideLoop.kt.after @@ -7,8 +7,8 @@ fun foo(list: List, o: Any) { unresolvedFun() val result: Any? = list - .map { it.length + (o as String).capitalize().hashCode() } - .map { it * o.length } - .firstOrNull { it > 1000 } + .map { it.length + (o as String).capitalize().hashCode() } + .map { it * o.length } + .firstOrNull { it > 1000 } } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/smartCasts/errorOutsideLoop.kt.after2 b/idea/testData/intentions/loopToCallChain/smartCasts/errorOutsideLoop.kt.after2 index 64b8b007f68..433f70ee13a 100644 --- a/idea/testData/intentions/loopToCallChain/smartCasts/errorOutsideLoop.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/smartCasts/errorOutsideLoop.kt.after2 @@ -7,9 +7,9 @@ fun foo(list: List, o: Any) { unresolvedFun() val result: Any? = list - .asSequence() - .map { it.length + (o as String).capitalize().hashCode() } - .map { it * o.length } - .firstOrNull { it > 1000 } + .asSequence() + .map { it.length + (o as String).capitalize().hashCode() } + .map { it * o.length } + .firstOrNull { it > 1000 } } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken.kt.after b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken.kt.after index 06cdd4d5112..33dfcac571c 100644 --- a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken.kt.after +++ b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken.kt.after @@ -4,10 +4,10 @@ fun foo(list: List, o: Any): Int? { if (o is Int) { return list - .map { it.length + o } - .filter { it > 0 } - .map { it * o.hashCode() } - .firstOrNull() + .map { it.length + o } + .filter { it > 0 } + .map { it * o.hashCode() } + .firstOrNull() } return 0 } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken.kt.after2 b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken.kt.after2 index d9d557107ba..47b791b6b15 100644 --- a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken.kt.after2 @@ -4,11 +4,11 @@ fun foo(list: List, o: Any): Int? { if (o is Int) { return list - .asSequence() - .map { it.length + o } - .filter { it > 0 } - .map { it * o.hashCode() } - .firstOrNull() + .asSequence() + .map { it.length + o } + .filter { it > 0 } + .map { it * o.hashCode() } + .firstOrNull() } return 0 } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken2.kt.after b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken2.kt.after index 9a4784652d4..b5b4506da32 100644 --- a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken2.kt.after +++ b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken2.kt.after @@ -4,9 +4,9 @@ fun foo(list: List, o: Any): Int? { if (o is CharSequence) { return list - .map { it.length + (o as String).capitalize().hashCode() } - .map { it * o.length } - .firstOrNull { it > 1000 } + .map { it.length + (o as String).capitalize().hashCode() } + .map { it * o.length } + .firstOrNull { it > 1000 } } return 0 } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken2.kt.after2 b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken2.kt.after2 index 8749d18e93e..0a9f14d1c64 100644 --- a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken2.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken2.kt.after2 @@ -4,10 +4,10 @@ fun foo(list: List, o: Any): Int? { if (o is CharSequence) { return list - .asSequence() - .map { it.length + (o as String).capitalize().hashCode() } - .map { it * o.length } - .firstOrNull { it > 1000 } + .asSequence() + .map { it.length + (o as String).capitalize().hashCode() } + .map { it * o.length } + .firstOrNull { it > 1000 } } return 0 } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken3.kt.after b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken3.kt.after index 98ebc3b54c8..f62a9e6aaa6 100644 --- a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken3.kt.after +++ b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken3.kt.after @@ -4,8 +4,8 @@ fun foo(list: List, o: Any) { if (o is CharSequence) { val result: Any? = list - .map { it.length + (o as String).capitalize().hashCode() } - .map { it * o.length } - .firstOrNull { it > 1000 } + .map { it.length + (o as String).capitalize().hashCode() } + .map { it * o.length } + .firstOrNull { it > 1000 } } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken3.kt.after2 b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken3.kt.after2 index b5e46442f4f..f5c352a15d3 100644 --- a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken3.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken3.kt.after2 @@ -4,9 +4,9 @@ fun foo(list: List, o: Any) { if (o is CharSequence) { val result: Any? = list - .asSequence() - .map { it.length + (o as String).capitalize().hashCode() } - .map { it * o.length } - .firstOrNull { it > 1000 } + .asSequence() + .map { it.length + (o as String).capitalize().hashCode() } + .map { it * o.length } + .firstOrNull { it > 1000 } } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken4.kt.after b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken4.kt.after index 3a46ded84df..4017d739e41 100644 --- a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken4.kt.after +++ b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken4.kt.after @@ -5,8 +5,8 @@ fun foo(list: List, o: Any) { var result: Any? = "" if (o is CharSequence) { result = list - .map { it.length + (o as String).capitalize().hashCode() } - .map { it * o.length } - .firstOrNull { it > 1000 } + .map { it.length + (o as String).capitalize().hashCode() } + .map { it * o.length } + .firstOrNull { it > 1000 } } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken4.kt.after2 b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken4.kt.after2 index 78a956b96a1..b38b2a962f7 100644 --- a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken4.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken4.kt.after2 @@ -5,9 +5,9 @@ fun foo(list: List, o: Any) { var result: Any? = "" if (o is CharSequence) { result = list - .asSequence() - .map { it.length + (o as String).capitalize().hashCode() } - .map { it * o.length } - .firstOrNull { it > 1000 } + .asSequence() + .map { it.length + (o as String).capitalize().hashCode() } + .map { it * o.length } + .firstOrNull { it > 1000 } } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken5.kt.after b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken5.kt.after index c5110362daf..d379f4404d7 100644 --- a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken5.kt.after +++ b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken5.kt.after @@ -4,8 +4,8 @@ fun foo(list: List, o: Any, result: MutableCollection) { if (o is CharSequence) { list - .map { it.length + (o as String).capitalize().hashCode() } - .map { it * o.length } - .filterTo(result) { it > 1000 } + .map { it.length + (o as String).capitalize().hashCode() } + .map { it * o.length } + .filterTo(result) { it > 1000 } } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken5.kt.after2 b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken5.kt.after2 index 8222d415488..2e2f945429c 100644 --- a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken5.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotBroken5.kt.after2 @@ -4,9 +4,9 @@ fun foo(list: List, o: Any, result: MutableCollection) { if (o is CharSequence) { list - .asSequence() - .map { it.length + (o as String).capitalize().hashCode() } - .map { it * o.length } - .filterTo(result) { it > 1000 } + .asSequence() + .map { it.length + (o as String).capitalize().hashCode() } + .map { it * o.length } + .filterTo(result) { it > 1000 } } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotRequired.kt.after b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotRequired.kt.after index 9a5f2a9d3fe..790f6145690 100644 --- a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotRequired.kt.after +++ b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotRequired.kt.after @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence()...filter{}.map{}.firstOrNull()'" fun foo(list: List, o: Any): Int? { return list - .map { it.length + (o as Int) } - .filter { it > 0 } - .map { it * o.hashCode() } - .firstOrNull() + .map { it.length + (o as Int) } + .filter { it > 0 } + .map { it * o.hashCode() } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotRequired.kt.after2 b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotRequired.kt.after2 index 9785114da04..692098e9d1e 100644 --- a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotRequired.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastNotRequired.kt.after2 @@ -3,9 +3,9 @@ // INTENTION_TEXT_2: "Replace with 'asSequence()...filter{}.map{}.firstOrNull()'" fun foo(list: List, o: Any): Int? { return list - .asSequence() - .map { it.length + (o as Int) } - .filter { it > 0 } - .map { it * o.hashCode() } - .firstOrNull() + .asSequence() + .map { it.length + (o as Int) } + .filter { it > 0 } + .map { it * o.hashCode() } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastRequired2.kt.after b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastRequired2.kt.after index d4599a154d1..bcb0a41a52c 100644 --- a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastRequired2.kt.after +++ b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastRequired2.kt.after @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence()...filter{}.map{}.firstOrNull()'" fun foo(list: List, o: Any): Int? { return list - .filterIsInstance() - .filter { it.length > 0 } - .map { it.length * 2 } - .firstOrNull() + .filterIsInstance() + .filter { it.length > 0 } + .map { it.length * 2 } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastRequired2.kt.after2 b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastRequired2.kt.after2 index e03b639d8f9..f76f652ecd8 100644 --- a/idea/testData/intentions/loopToCallChain/smartCasts/smartCastRequired2.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/smartCasts/smartCastRequired2.kt.after2 @@ -3,9 +3,9 @@ // INTENTION_TEXT_2: "Replace with 'asSequence()...filter{}.map{}.firstOrNull()'" fun foo(list: List, o: Any): Int? { return list - .asSequence() - .filterIsInstance() - .filter { it.length > 0 } - .map { it.length * 2 } - .firstOrNull() + .asSequence() + .filterIsInstance() + .filter { it.length > 0 } + .map { it.length * 2 } + .firstOrNull() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/sum/indexUsed.kt.after b/idea/testData/intentions/loopToCallChain/sum/indexUsed.kt.after index 117c1f04d9b..1ea31942c36 100644 --- a/idea/testData/intentions/loopToCallChain/sum/indexUsed.kt.after +++ b/idea/testData/intentions/loopToCallChain/sum/indexUsed.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.sum()'" fun foo(list: List): Int { val s = list - .mapIndexed { index, item -> item * index } - .sum() + .mapIndexed { index, item -> item * index } + .sum() return s } diff --git a/idea/testData/intentions/loopToCallChain/sum/indexUsed.kt.after2 b/idea/testData/intentions/loopToCallChain/sum/indexUsed.kt.after2 index 06c80e7e589..531be125948 100644 --- a/idea/testData/intentions/loopToCallChain/sum/indexUsed.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/sum/indexUsed.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.sum()'" fun foo(list: List): Int { val s = list - .asSequence() - .mapIndexed { index, item -> item * index } - .sum() + .asSequence() + .mapIndexed { index, item -> item * index } + .sum() return s } diff --git a/idea/testData/intentions/loopToCallChain/sum/indexUsed2.kt.after b/idea/testData/intentions/loopToCallChain/sum/indexUsed2.kt.after index 7027cf9680c..01a7539c74f 100644 --- a/idea/testData/intentions/loopToCallChain/sum/indexUsed2.kt.after +++ b/idea/testData/intentions/loopToCallChain/sum/indexUsed2.kt.after @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.sum()'" fun foo(list: List): Int { val s = list - .mapIndexed { index, item -> getShort(index, item) } - .sum() + .mapIndexed { index, item -> getShort(index, item) } + .sum() return s } diff --git a/idea/testData/intentions/loopToCallChain/sum/indexUsed2.kt.after2 b/idea/testData/intentions/loopToCallChain/sum/indexUsed2.kt.after2 index 8882a6d1899..e2efed97d17 100644 --- a/idea/testData/intentions/loopToCallChain/sum/indexUsed2.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/sum/indexUsed2.kt.after2 @@ -3,9 +3,9 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.sum()'" fun foo(list: List): Int { val s = list - .asSequence() - .mapIndexed { index, item -> getShort(index, item) } - .sum() + .asSequence() + .mapIndexed { index, item -> getShort(index, item) } + .sum() return s } diff --git a/idea/testData/intentions/loopToCallChain/sum/smartCast.kt.after b/idea/testData/intentions/loopToCallChain/sum/smartCast.kt.after index 4050082f424..7a624db1bda 100644 --- a/idea/testData/intentions/loopToCallChain/sum/smartCast.kt.after +++ b/idea/testData/intentions/loopToCallChain/sum/smartCast.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIsInstance<>().sum()'" fun foo(list: List){ val result = list - .filterIsInstance() - .sum() + .filterIsInstance() + .sum() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/sum/smartCast.kt.after2 b/idea/testData/intentions/loopToCallChain/sum/smartCast.kt.after2 index d83be6f5e99..0364863fbf9 100644 --- a/idea/testData/intentions/loopToCallChain/sum/smartCast.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/sum/smartCast.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterIsInstance<>().sum()'" fun foo(list: List){ val result = list - .asSequence() - .filterIsInstance() - .sum() + .asSequence() + .filterIsInstance() + .sum() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/sum/smartCastNotNull.kt.after b/idea/testData/intentions/loopToCallChain/sum/smartCastNotNull.kt.after index 19f30da5928..f1f140033c3 100644 --- a/idea/testData/intentions/loopToCallChain/sum/smartCastNotNull.kt.after +++ b/idea/testData/intentions/loopToCallChain/sum/smartCastNotNull.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNotNull().sum()'" fun foo(list: List){ val result = list - .filterNotNull() - .sum() + .filterNotNull() + .sum() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/sum/smartCastNotNull.kt.after2 b/idea/testData/intentions/loopToCallChain/sum/smartCastNotNull.kt.after2 index f413b447854..6ccbaa60f31 100644 --- a/idea/testData/intentions/loopToCallChain/sum/smartCastNotNull.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/sum/smartCastNotNull.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().filterNotNull().sum()'" fun foo(list: List){ val result = list - .asSequence() - .filterNotNull() - .sum() + .asSequence() + .filterNotNull() + .sum() } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/sum/sumByIntsIntoLong.kt.after b/idea/testData/intentions/loopToCallChain/sum/sumByIntsIntoLong.kt.after index 71c9a6dd767..12071ac4d8a 100644 --- a/idea/testData/intentions/loopToCallChain/sum/sumByIntsIntoLong.kt.after +++ b/idea/testData/intentions/loopToCallChain/sum/sumByIntsIntoLong.kt.after @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.sum()'" fun foo(list: List): Long { val s = list - .map { it.toLong() } - .sum() + .map { it.toLong() } + .sum() return s } diff --git a/idea/testData/intentions/loopToCallChain/sum/sumByIntsIntoLong.kt.after2 b/idea/testData/intentions/loopToCallChain/sum/sumByIntsIntoLong.kt.after2 index ddf3858af3a..65c99c7d2c6 100644 --- a/idea/testData/intentions/loopToCallChain/sum/sumByIntsIntoLong.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/sum/sumByIntsIntoLong.kt.after2 @@ -3,8 +3,8 @@ // INTENTION_TEXT_2: "Replace with 'asSequence().map{}.sum()'" fun foo(list: List): Long { val s = list - .asSequence() - .map { it.toLong() } - .sum() + .asSequence() + .map { it.toLong() } + .sum() return s } diff --git a/idea/testData/intentions/loopToCallChain/takeWhile/nestedLoop.kt.after b/idea/testData/intentions/loopToCallChain/takeWhile/nestedLoop.kt.after index 46de422a7e6..3ddd5cfc91c 100644 --- a/idea/testData/intentions/loopToCallChain/takeWhile/nestedLoop.kt.after +++ b/idea/testData/intentions/loopToCallChain/takeWhile/nestedLoop.kt.after @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with '+= asSequence().flatMap{}.takeWhile{}'" fun foo(list: List, target: MutableCollection) { target += list - .flatMap { it.indices } - .takeWhile { it <= 1000 } + .flatMap { it.indices } + .takeWhile { it <= 1000 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/takeWhile/nestedLoop.kt.after2 b/idea/testData/intentions/loopToCallChain/takeWhile/nestedLoop.kt.after2 index 7444e01897b..436452ab148 100644 --- a/idea/testData/intentions/loopToCallChain/takeWhile/nestedLoop.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/takeWhile/nestedLoop.kt.after2 @@ -3,7 +3,7 @@ // INTENTION_TEXT_2: "Replace with '+= asSequence().flatMap{}.takeWhile{}'" fun foo(list: List, target: MutableCollection) { target += list - .asSequence() - .flatMap { it.indices.asSequence() } - .takeWhile { it <= 1000 } + .asSequence() + .flatMap { it.indices.asSequence() } + .takeWhile { it <= 1000 } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/takeWhile/simple.kt.after2 b/idea/testData/intentions/loopToCallChain/takeWhile/simple.kt.after2 index 0f70a2a9ce6..723f142bc6a 100644 --- a/idea/testData/intentions/loopToCallChain/takeWhile/simple.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/takeWhile/simple.kt.after2 @@ -3,6 +3,6 @@ // INTENTION_TEXT_2: "Replace with '+= asSequence().takeWhile{}'" fun foo(list: List, target: MutableCollection) { target += list - .asSequence() - .takeWhile { !it.isEmpty() } + .asSequence() + .takeWhile { !it.isEmpty() } } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/toCollection/resultCollectionUsedInsideLoop.kt.after b/idea/testData/intentions/loopToCallChain/toCollection/resultCollectionUsedInsideLoop.kt.after index 69eefe2d673..edaf81b25a5 100644 --- a/idea/testData/intentions/loopToCallChain/toCollection/resultCollectionUsedInsideLoop.kt.after +++ b/idea/testData/intentions/loopToCallChain/toCollection/resultCollectionUsedInsideLoop.kt.after @@ -6,7 +6,7 @@ import java.util.ArrayList fun foo(list: List): List { val result = ArrayList() list - .filter { it.length > result.size } - .forEach { result.add(it.hashCode()) } + .filter { it.length > result.size } + .forEach { result.add(it.hashCode()) } return result } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/toCollection/resultCollectionUsedInsideLoop.kt.after2 b/idea/testData/intentions/loopToCallChain/toCollection/resultCollectionUsedInsideLoop.kt.after2 index 9e849ec29ba..3e4a93792df 100644 --- a/idea/testData/intentions/loopToCallChain/toCollection/resultCollectionUsedInsideLoop.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/toCollection/resultCollectionUsedInsideLoop.kt.after2 @@ -6,8 +6,8 @@ import java.util.ArrayList fun foo(list: List): List { val result = ArrayList() list - .asSequence() - .filter { it.length > result.size } - .forEach { result.add(it.hashCode()) } + .asSequence() + .filter { it.length > result.size } + .forEach { result.add(it.hashCode()) } return result } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/toCollection/toSetWithMap.kt.after b/idea/testData/intentions/loopToCallChain/toCollection/toSetWithMap.kt.after index 763755501b9..32575c5cbe4 100644 --- a/idea/testData/intentions/loopToCallChain/toCollection/toSetWithMap.kt.after +++ b/idea/testData/intentions/loopToCallChain/toCollection/toSetWithMap.kt.after @@ -5,7 +5,7 @@ import java.util.HashSet fun foo(map: Map): Collection { val result = map.values - .map { it.length } - .toSet() + .map { it.length } + .toSet() return result } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/toCollection/toSetWithMap.kt.after2 b/idea/testData/intentions/loopToCallChain/toCollection/toSetWithMap.kt.after2 index 2e687e91477..e33687a2d1a 100644 --- a/idea/testData/intentions/loopToCallChain/toCollection/toSetWithMap.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/toCollection/toSetWithMap.kt.after2 @@ -5,8 +5,8 @@ import java.util.HashSet fun foo(map: Map): Collection { val result = map.values - .asSequence() - .map { it.length } - .toSet() + .asSequence() + .map { it.length } + .toSet() return result } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/twoInitializationsBeforeLoop.kt.after b/idea/testData/intentions/loopToCallChain/twoInitializationsBeforeLoop.kt.after index 241e4620abd..40edffeb8b7 100644 --- a/idea/testData/intentions/loopToCallChain/twoInitializationsBeforeLoop.kt.after +++ b/idea/testData/intentions/loopToCallChain/twoInitializationsBeforeLoop.kt.after @@ -5,7 +5,7 @@ import java.util.* fun foo(list: List): List { val result = list - .filterIndexed { i, s -> s.length > i } - .map { it.length } + .filterIndexed { i, s -> s.length > i } + .map { it.length } return result } \ No newline at end of file diff --git a/idea/testData/intentions/loopToCallChain/twoInitializationsBeforeLoop.kt.after2 b/idea/testData/intentions/loopToCallChain/twoInitializationsBeforeLoop.kt.after2 index d3852e8753c..ffe68d50b7e 100644 --- a/idea/testData/intentions/loopToCallChain/twoInitializationsBeforeLoop.kt.after2 +++ b/idea/testData/intentions/loopToCallChain/twoInitializationsBeforeLoop.kt.after2 @@ -5,9 +5,9 @@ import java.util.* fun foo(list: List): List { val result = list - .asSequence() - .filterIndexed { i, s -> s.length > i } - .map { it.length } - .toList() + .asSequence() + .filterIndexed { i, s -> s.length > i } + .map { it.length } + .toList() return result } \ No newline at end of file diff --git a/idea/testData/intentions/movePropertyToConstructor/annotationTarget.kt.after b/idea/testData/intentions/movePropertyToConstructor/annotationTarget.kt.after index db80f2a6c17..6cc2e2a5d1d 100644 --- a/idea/testData/intentions/movePropertyToConstructor/annotationTarget.kt.after +++ b/idea/testData/intentions/movePropertyToConstructor/annotationTarget.kt.after @@ -12,5 +12,10 @@ annotation class Ann4(val i: Int, val j: Int) @Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.FIELD) annotation class Ann5(val i: Int, val j: Int) -class Test(@get:Ann1(0, 0) @property:Ann1(1, 11) @Ann2(2, 22) @Ann3(3, 33) @property:Ann4(4, 44) @field:Ann5(5, 55) val foo: String = "") { +class Test( + @get:Ann1(0, 0) @property:Ann1(1, 11) @Ann2(2, 22) @Ann3(3, 33) @property:Ann4(4, 44) @field:Ann5( + 5, + 55 + ) val foo: String = "" +) { } \ No newline at end of file diff --git a/idea/testData/intentions/movePropertyToConstructor/functionReference.kt.after b/idea/testData/intentions/movePropertyToConstructor/functionReference.kt.after index fcbafe0c758..391688c3dbb 100644 --- a/idea/testData/intentions/movePropertyToConstructor/functionReference.kt.after +++ b/idea/testData/intentions/movePropertyToConstructor/functionReference.kt.after @@ -6,5 +6,9 @@ fun foo(a: Int, b: String, d: Baz) { } -class TestClass(val prop1: KFunction3<@ParameterName(name = "a") Int, @ParameterName(name = "b") String, @ParameterName(name = "d") Baz, Unit> = ::foo) { +class TestClass( + val prop1: KFunction3<@ParameterName(name = "a") Int, @ParameterName(name = "b") String, @ParameterName( + name = "d" + ) Baz, Unit> = ::foo +) { } \ No newline at end of file diff --git a/idea/testData/intentions/movePropertyToConstructor/withoutMatchingParameter.kt.after b/idea/testData/intentions/movePropertyToConstructor/withoutMatchingParameter.kt.after index e310a176513..128690c0a93 100644 --- a/idea/testData/intentions/movePropertyToConstructor/withoutMatchingParameter.kt.after +++ b/idea/testData/intentions/movePropertyToConstructor/withoutMatchingParameter.kt.after @@ -3,5 +3,7 @@ annotation class Annotation2(val a: Int = 0) annotation class Annotation3(val a: Int = 0) -class TestClass(@Annotation1(42) @Annotation3(42) initialText: String = "LoremIpsum", private @property:Annotation1(42) @field:Annotation2(42) val text: String = "dolor sit amet") { +class TestClass(@Annotation1(42) @Annotation3(42) initialText: String = "LoremIpsum", + private @property:Annotation1(42) @field:Annotation2(42) val text: String = "dolor sit amet" +) { } \ No newline at end of file diff --git a/idea/testData/intentions/operatorToFunction/keepComments.kt.after b/idea/testData/intentions/operatorToFunction/keepComments.kt.after index b23549c9a76..8415ec849ca 100644 --- a/idea/testData/intentions/operatorToFunction/keepComments.kt.after +++ b/idea/testData/intentions/operatorToFunction/keepComments.kt.after @@ -4,7 +4,9 @@ interface C { class D(val c: C) { fun foo() { - this.c/* and this is c */.set("a", // it's "a" - "b" /* and this is "b" */, /* we use 10 */10) + this.c/* and this is c */.set( + "a", // it's "a" + "b" /* and this is "b" */, /* we use 10 */10 + ) } } diff --git a/idea/testData/multiModuleQuickFix/createExpect/topLevelFunctionWithAnnotations/common/myExtension.kt.after b/idea/testData/multiModuleQuickFix/createExpect/topLevelFunctionWithAnnotations/common/myExtension.kt.after index 9a9217beb69..edf536a7fa3 100644 --- a/idea/testData/multiModuleQuickFix/createExpect/topLevelFunctionWithAnnotations/common/myExtension.kt.after +++ b/idea/testData/multiModuleQuickFix/createExpect/topLevelFunctionWithAnnotations/common/myExtension.kt.after @@ -1 +1,3 @@ -expect fun >> @receiver:SimpleA String.myExtension(@SimpleA a: @SimpleA List<@SimpleA List<@SimpleA String>>) \ No newline at end of file +expect fun >> @receiver:SimpleA String.myExtension( + @SimpleA a: @SimpleA List<@SimpleA List<@SimpleA String>> +) \ No newline at end of file diff --git a/idea/testData/quickfix/addAnnotationTarget/withJava.after.kt b/idea/testData/quickfix/addAnnotationTarget/withJava.after.kt index f9eaff9b8f2..c8558eed861 100644 --- a/idea/testData/quickfix/addAnnotationTarget/withJava.after.kt +++ b/idea/testData/quickfix/addAnnotationTarget/withJava.after.kt @@ -3,7 +3,14 @@ package test -@Target(AnnotationTarget.CLASS, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.EXPRESSION) +@Target( + AnnotationTarget.CLASS, + AnnotationTarget.LOCAL_VARIABLE, + AnnotationTarget.VALUE_PARAMETER, + AnnotationTarget.CONSTRUCTOR, + AnnotationTarget.FUNCTION, + AnnotationTarget.EXPRESSION +) @Retention(AnnotationRetention.SOURCE) annotation class AnnTarget @@ -11,6 +18,6 @@ fun println(v: Int) {} fun apply() { var v = 0 - @AnnTarget v++ + @AnnTarget v++ println(v) } \ No newline at end of file diff --git a/idea/testData/quickfix/canBePrimaryConstructorProperty/commentAhead.kt.after b/idea/testData/quickfix/canBePrimaryConstructorProperty/commentAhead.kt.after index 2d2629e8729..af38e628375 100644 --- a/idea/testData/quickfix/canBePrimaryConstructorProperty/commentAhead.kt.after +++ b/idea/testData/quickfix/canBePrimaryConstructorProperty/commentAhead.kt.after @@ -1,7 +1,7 @@ // "Move to constructor" "true" class Complex( - /** - * Very complex field x - */ - val x: Int, y: Double, z: String) { + /** + * Very complex field x + */ + val x: Int, y: Double, z: String) { } \ No newline at end of file diff --git a/idea/testData/quickfix/createFromUsage/createVariable/parameter/dataClassPropertyByNamedArgument.kt.after b/idea/testData/quickfix/createFromUsage/createVariable/parameter/dataClassPropertyByNamedArgument.kt.after index a280e115b1c..614b0822947 100644 --- a/idea/testData/quickfix/createFromUsage/createVariable/parameter/dataClassPropertyByNamedArgument.kt.after +++ b/idea/testData/quickfix/createFromUsage/createVariable/parameter/dataClassPropertyByNamedArgument.kt.after @@ -1,10 +1,10 @@ // "Create property 'parameter4' as constructor parameter" "true" data class MyDto( - val parameter1: String, - val parameter2: String = "", - val parameter3: String = "", - val parameter4: String + val parameter1: String, + val parameter2: String = "", + val parameter3: String = "", + val parameter4: String ) fun main(args: Array) { diff --git a/idea/testData/quickfix/createLabel/breakInLoop.kt.after b/idea/testData/quickfix/createLabel/breakInLoop.kt.after index 5277993aedb..8592354d708 100644 --- a/idea/testData/quickfix/createLabel/breakInLoop.kt.after +++ b/idea/testData/quickfix/createLabel/breakInLoop.kt.after @@ -2,6 +2,6 @@ fun test() { foo@ while (true) { - break@foo + break@foo } } \ No newline at end of file diff --git a/idea/testData/quickfix/createLabel/breakInOuterLoop.kt.after b/idea/testData/quickfix/createLabel/breakInOuterLoop.kt.after index 2a459f8e4b0..a2cd0e0c33b 100644 --- a/idea/testData/quickfix/createLabel/breakInOuterLoop.kt.after +++ b/idea/testData/quickfix/createLabel/breakInOuterLoop.kt.after @@ -3,7 +3,7 @@ fun test() { foo@ while (true) { while (true) { - break@foo + break@foo } } } \ No newline at end of file diff --git a/idea/testData/quickfix/createLabel/continueInLoop.kt.after b/idea/testData/quickfix/createLabel/continueInLoop.kt.after index 5329a2d8424..6e66dc3d76d 100644 --- a/idea/testData/quickfix/createLabel/continueInLoop.kt.after +++ b/idea/testData/quickfix/createLabel/continueInLoop.kt.after @@ -2,6 +2,6 @@ fun test() { foo@ while (true) { - continue@foo + continue@foo } } \ No newline at end of file diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/addArguments.kt.after b/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/addArguments.kt.after index 0cd34007e18..38756b14082 100644 --- a/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/addArguments.kt.after +++ b/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/addArguments.kt.after @@ -7,7 +7,9 @@ fun newFun(p1: Int, a: Int, p2: Int, p3: Int, b: Int){} fun foo() { - newFun(0, // 0 - -1, 1, // 1 - 2, // 2 - -2) + newFun( + 0, // 0 + -1, 1, // 1 + 2, // 2 + -2 + ) diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/commentBeforeArgument.kt.after b/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/commentBeforeArgument.kt.after index 1ab6cf8d55e..50dcd96d60c 100644 --- a/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/commentBeforeArgument.kt.after +++ b/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/commentBeforeArgument.kt.after @@ -8,6 +8,7 @@ fun newFun(p4: Int, p3: Int, p2: Int, p1: Int, p0: Int){} fun foo() { newFun(/* 4 */ 4, 3, 2, // 2 - /* 1 */ 1, - /* 0 */ 0) + /* 1 */ 1, + /* 0 */ 0 + ) } diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/multipleArguments.kt.after b/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/multipleArguments.kt.after index b1565b42df9..36a4e80cd8c 100644 --- a/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/multipleArguments.kt.after +++ b/idea/testData/quickfix/deprecatedSymbolUsage/keepComments/multipleArguments.kt.after @@ -8,7 +8,8 @@ interface X { fun newFun(x: X, a: Int, b: Int){} fun foo(x: X) { - newFun(x/*receiver*/, 1, // pass 1 - 2 // pass 2 + newFun( + x/*receiver*/, 1, // pass 1 + 2 // pass 2 ) } diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/addArgument.kt.after b/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/addArgument.kt.after index fc116e658a2..2f2ede1b446 100644 --- a/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/addArgument.kt.after +++ b/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/addArgument.kt.after @@ -9,7 +9,8 @@ interface X { fun foo(x: X) { x.newFun( - 1, - 2, - 0) + 1, + 2, + 0 + ) } diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/lineBreakAfterReceiverRuntime.kt.after b/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/lineBreakAfterReceiverRuntime.kt.after index 6811d1690f0..b3f5d0c38c5 100644 --- a/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/lineBreakAfterReceiverRuntime.kt.after +++ b/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/lineBreakAfterReceiverRuntime.kt.after @@ -8,8 +8,8 @@ fun Int.newFun(): Int = this fun foo(list: List): Int { return list - .filter { it.isNotEmpty() } - .map { it.length } - .first() - .newFun() + .filter { it.isNotEmpty() } + .map { it.length } + .first() + .newFun() } diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/simple.kt.after b/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/simple.kt.after index 56f9d27ce03..5351004a71b 100644 --- a/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/simple.kt.after +++ b/idea/testData/quickfix/deprecatedSymbolUsage/keepLineBreaks/simple.kt.after @@ -8,7 +8,9 @@ interface X { } fun foo(x: X) { - x.newFun(1, - 2, - 3) + x.newFun( + 1, + 2, + 3 + ) } diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/optionalParameters/optionalParameterAndLambdaComplex.kt.after b/idea/testData/quickfix/deprecatedSymbolUsage/optionalParameters/optionalParameterAndLambdaComplex.kt.after index 8bdc3d7ab68..5d5f7263420 100644 --- a/idea/testData/quickfix/deprecatedSymbolUsage/optionalParameters/optionalParameterAndLambdaComplex.kt.after +++ b/idea/testData/quickfix/deprecatedSymbolUsage/optionalParameters/optionalParameterAndLambdaComplex.kt.after @@ -35,6 +35,6 @@ fun createHi(any: Any) = "Hi $any" val unDeprecateMe = mutableListOf("Hello").apply { addA(d(::createHi, 1 ) { // Run the quick fix from the IDE and watch it produce broken code. - println("Yo") - }, Unit) + println("Yo") + }, Unit) } \ No newline at end of file diff --git a/idea/testData/quickfix/foldTryCatch/conditional.kt b/idea/testData/quickfix/foldTryCatch/conditional.kt index fed8a172654..434d2c43022 100644 --- a/idea/testData/quickfix/foldTryCatch/conditional.kt +++ b/idea/testData/quickfix/foldTryCatch/conditional.kt @@ -9,8 +9,7 @@ fun foo(arg: Boolean) { if (arg) { x = 1 } - } - catch (e: Exception) { + } catch (e: Exception) { x = 2 } } \ No newline at end of file diff --git a/idea/testData/quickfix/foldTryCatch/emptyFinally.kt b/idea/testData/quickfix/foldTryCatch/emptyFinally.kt index ea929579f0f..350fa2a40ba 100644 --- a/idea/testData/quickfix/foldTryCatch/emptyFinally.kt +++ b/idea/testData/quickfix/foldTryCatch/emptyFinally.kt @@ -5,9 +5,7 @@ fun foo() { val x: Int try { x = 1 - } - catch (e: Exception) { + } catch (e: Exception) { x = 2 - } - finally {} + } finally {} } \ No newline at end of file diff --git a/idea/testData/quickfix/foldTryCatch/multipleExceptions.kt b/idea/testData/quickfix/foldTryCatch/multipleExceptions.kt index 49c559aa4a1..c34024f0dbd 100644 --- a/idea/testData/quickfix/foldTryCatch/multipleExceptions.kt +++ b/idea/testData/quickfix/foldTryCatch/multipleExceptions.kt @@ -5,14 +5,11 @@ fun foo() { val x: Int try { x = 1 - } - catch (e: RuntimeException) { + } catch (e: RuntimeException) { x = 2 - } - catch (e: Exception) { + } catch (e: Exception) { x = 3 - } - catch (e: Throwable) { + } catch (e: Throwable) { x = 4 } } \ No newline at end of file diff --git a/idea/testData/quickfix/foldTryCatch/shadow.kt b/idea/testData/quickfix/foldTryCatch/shadow.kt index bbd9bb52edb..2d7f8130a6a 100644 --- a/idea/testData/quickfix/foldTryCatch/shadow.kt +++ b/idea/testData/quickfix/foldTryCatch/shadow.kt @@ -10,8 +10,7 @@ fun foo() { try { val x = 2 x = 3 - } - catch(e: Exception) { + } catch(e: Exception) { x = 4 } } \ No newline at end of file diff --git a/idea/testData/quickfix/foldTryCatch/simple.kt b/idea/testData/quickfix/foldTryCatch/simple.kt index f3c675a0e1d..d14bc632595 100644 --- a/idea/testData/quickfix/foldTryCatch/simple.kt +++ b/idea/testData/quickfix/foldTryCatch/simple.kt @@ -5,8 +5,7 @@ fun foo() { val x: Int try { x = 1 - } - catch (e: Exception) { + } catch (e: Exception) { x = 2 } } \ No newline at end of file diff --git a/idea/testData/quickfix/replaceWithDotCall/comment.kt.after b/idea/testData/quickfix/replaceWithDotCall/comment.kt.after index 839216da443..b43a1d7c056 100644 --- a/idea/testData/quickfix/replaceWithDotCall/comment.kt.after +++ b/idea/testData/quickfix/replaceWithDotCall/comment.kt.after @@ -2,6 +2,6 @@ // WITH_RUNTIME fun foo(a: String) { val b = a // comment1 - // comment2 - .length + // comment2 + .length } \ No newline at end of file diff --git a/idea/testData/quickfix/replaceWithDotCall/lineBreak.kt.after b/idea/testData/quickfix/replaceWithDotCall/lineBreak.kt.after index c3b1e09ef0f..299bc76ba19 100644 --- a/idea/testData/quickfix/replaceWithDotCall/lineBreak.kt.after +++ b/idea/testData/quickfix/replaceWithDotCall/lineBreak.kt.after @@ -2,5 +2,5 @@ // WITH_RUNTIME fun foo(a: String) { val b = a - .length + .length } \ No newline at end of file diff --git a/idea/testData/quickfix/replaceWithSafeCall/comment.kt.after b/idea/testData/quickfix/replaceWithSafeCall/comment.kt.after index 590fa8a84ae..0e7e8983b0e 100644 --- a/idea/testData/quickfix/replaceWithSafeCall/comment.kt.after +++ b/idea/testData/quickfix/replaceWithSafeCall/comment.kt.after @@ -2,6 +2,6 @@ // WITH_RUNTIME fun foo(a: String?) { val b = a // comment1 - // comment2 - ?.length + // comment2 + ?.length } \ No newline at end of file diff --git a/idea/testData/quickfix/replaceWithSafeCall/lineBreak.kt.after b/idea/testData/quickfix/replaceWithSafeCall/lineBreak.kt.after index ec215e69e69..7fa6f6f649b 100644 --- a/idea/testData/quickfix/replaceWithSafeCall/lineBreak.kt.after +++ b/idea/testData/quickfix/replaceWithSafeCall/lineBreak.kt.after @@ -2,5 +2,5 @@ // WITH_RUNTIME fun foo(a: String?) { val b = a - ?.length + ?.length } \ No newline at end of file diff --git a/idea/testData/quickfix/replaceWithSafeCallForScopeFunction/comment.kt.after b/idea/testData/quickfix/replaceWithSafeCallForScopeFunction/comment.kt.after index 47bdccab9a7..9825c4c971d 100644 --- a/idea/testData/quickfix/replaceWithSafeCallForScopeFunction/comment.kt.after +++ b/idea/testData/quickfix/replaceWithSafeCallForScopeFunction/comment.kt.after @@ -2,8 +2,8 @@ // WITH_RUNTIME fun foo(a: String?) { val b = a // comment1 - // comment2 - ?.let { - it.length - } + // comment2 + ?.let { + it.length + } } \ No newline at end of file diff --git a/idea/testData/quickfix/replaceWithSafeCallForScopeFunction/lineBreak.kt.after b/idea/testData/quickfix/replaceWithSafeCallForScopeFunction/lineBreak.kt.after index de28123e523..cf0b5e057bf 100644 --- a/idea/testData/quickfix/replaceWithSafeCallForScopeFunction/lineBreak.kt.after +++ b/idea/testData/quickfix/replaceWithSafeCallForScopeFunction/lineBreak.kt.after @@ -2,7 +2,7 @@ // WITH_RUNTIME fun foo(a: String?) { val b = a - ?.let { - it.length - } + ?.let { + it.length + } } \ No newline at end of file diff --git a/idea/testData/quickfix/supertypeInitialization/someParametersAlreadyExist.kt.after b/idea/testData/quickfix/supertypeInitialization/someParametersAlreadyExist.kt.after index be2a520e7e6..251c0f37c65 100644 --- a/idea/testData/quickfix/supertypeInitialization/someParametersAlreadyExist.kt.after +++ b/idea/testData/quickfix/supertypeInitialization/someParametersAlreadyExist.kt.after @@ -5,4 +5,5 @@ // ERROR: Conflicting declarations: value-parameter p4: Any, value-parameter p4: String open class Base(p1: Int, private val p2: Int, p3: Any, p4: String, p5: T, p6: Int) -class C(p: Int, p2: Int, p3: String, p4: Any, p5: String, val p6: Int, p1: Int, p4: String) : Base(p1, p2, p3, p4, p5, p6) +class C(p: Int, p2: Int, p3: String, p4: Any, p5: String, val p6: Int, p1: Int, p4: String) : + Base(p1, p2, p3, p4, p5, p6) diff --git a/idea/testData/quickfix/typeOfAnnotationMember/boolean.kt.after b/idea/testData/quickfix/typeOfAnnotationMember/boolean.kt.after index def8ca8b6e1..e09cc10ce8e 100644 --- a/idea/testData/quickfix/typeOfAnnotationMember/boolean.kt.after +++ b/idea/testData/quickfix/typeOfAnnotationMember/boolean.kt.after @@ -1,5 +1,5 @@ // "Replace array of boxed with array of primitive" "true" annotation class SuperAnnotation( - val boo: BooleanArray, - val str: Array + val boo: BooleanArray, + val str: Array ) \ No newline at end of file diff --git a/idea/testData/quickfix/typeOfAnnotationMember/byte.kt.after b/idea/testData/quickfix/typeOfAnnotationMember/byte.kt.after index f6f2989aba6..8bf91128dc2 100644 --- a/idea/testData/quickfix/typeOfAnnotationMember/byte.kt.after +++ b/idea/testData/quickfix/typeOfAnnotationMember/byte.kt.after @@ -1,5 +1,5 @@ // "Replace array of boxed with array of primitive" "true" annotation class SuperAnnotation( - val b: ByteArray, - val str: Array + val b: ByteArray, + val str: Array ) \ No newline at end of file diff --git a/idea/testData/quickfix/typeOfAnnotationMember/char.kt.after b/idea/testData/quickfix/typeOfAnnotationMember/char.kt.after index 3cbbb974006..62046b48fae 100644 --- a/idea/testData/quickfix/typeOfAnnotationMember/char.kt.after +++ b/idea/testData/quickfix/typeOfAnnotationMember/char.kt.after @@ -1,5 +1,5 @@ // "Replace array of boxed with array of primitive" "true" annotation class SuperAnnotation( - val c: CharArray, - val str: Array + val c: CharArray, + val str: Array ) \ No newline at end of file diff --git a/idea/testData/quickfix/typeOfAnnotationMember/float.kt.after b/idea/testData/quickfix/typeOfAnnotationMember/float.kt.after index 41ca80a59fc..97191010e26 100644 --- a/idea/testData/quickfix/typeOfAnnotationMember/float.kt.after +++ b/idea/testData/quickfix/typeOfAnnotationMember/float.kt.after @@ -1,5 +1,5 @@ // "Replace array of boxed with array of primitive" "true" annotation class SuperAnnotation( - val f: FloatArray, - val str: Array + val f: FloatArray, + val str: Array ) \ No newline at end of file diff --git a/idea/testData/quickfix/typeOfAnnotationMember/int.kt.after b/idea/testData/quickfix/typeOfAnnotationMember/int.kt.after index 791997c8441..492247a696c 100644 --- a/idea/testData/quickfix/typeOfAnnotationMember/int.kt.after +++ b/idea/testData/quickfix/typeOfAnnotationMember/int.kt.after @@ -1,5 +1,5 @@ // "Replace array of boxed with array of primitive" "true" annotation class SuperAnnotation( - val i: IntArray, - val str: Array + val i: IntArray, + val str: Array ) \ No newline at end of file diff --git a/idea/testData/quickfix/typeOfAnnotationMember/long.kt.after b/idea/testData/quickfix/typeOfAnnotationMember/long.kt.after index ce62f6b99c7..babfd3deb0b 100644 --- a/idea/testData/quickfix/typeOfAnnotationMember/long.kt.after +++ b/idea/testData/quickfix/typeOfAnnotationMember/long.kt.after @@ -1,5 +1,5 @@ // "Replace array of boxed with array of primitive" "true" annotation class SuperAnnotation( - val l: LongArray, - val str: Array + val l: LongArray, + val str: Array ) \ No newline at end of file diff --git a/idea/testData/quickfix/typeOfAnnotationMember/short.kt.after b/idea/testData/quickfix/typeOfAnnotationMember/short.kt.after index b169d5fa7f2..adde59d8834 100644 --- a/idea/testData/quickfix/typeOfAnnotationMember/short.kt.after +++ b/idea/testData/quickfix/typeOfAnnotationMember/short.kt.after @@ -1,5 +1,5 @@ // "Replace array of boxed with array of primitive" "true" annotation class SuperAnnotation( - val s: ShortArray, - val str: Array + val s: ShortArray, + val str: Array ) \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignature/ConvertParameterToReceiverAddParensAfter.kt b/idea/testData/refactoring/changeSignature/ConvertParameterToReceiverAddParentsAfter.kt similarity index 100% rename from idea/testData/refactoring/changeSignature/ConvertParameterToReceiverAddParensAfter.kt rename to idea/testData/refactoring/changeSignature/ConvertParameterToReceiverAddParentsAfter.kt diff --git a/idea/testData/refactoring/changeSignature/ConvertParameterToReceiverAddParensBefore.kt b/idea/testData/refactoring/changeSignature/ConvertParameterToReceiverAddParentsBefore.kt similarity index 100% rename from idea/testData/refactoring/changeSignature/ConvertParameterToReceiverAddParensBefore.kt rename to idea/testData/refactoring/changeSignature/ConvertParameterToReceiverAddParentsBefore.kt diff --git a/idea/testData/refactoring/extractFunction/controlFlow/outputValues/tooManyOutputValuesAsList.kt.after b/idea/testData/refactoring/extractFunction/controlFlow/outputValues/tooManyOutputValuesAsList.kt.after index 7634c02eb94..db7ba6ca8c5 100644 --- a/idea/testData/refactoring/extractFunction/controlFlow/outputValues/tooManyOutputValuesAsList.kt.after +++ b/idea/testData/refactoring/extractFunction/controlFlow/outputValues/tooManyOutputValuesAsList.kt.after @@ -26,7 +26,13 @@ fun foo(a: Int): Int { return b + c + d + e } -private fun list(b: Int, a: Int, c: Int, d: Int, e: Int): List { +private fun list( + b: Int, + a: Int, + c: Int, + d: Int, + e: Int +): List { var b1 = b var c1 = c var d1 = d diff --git a/idea/testData/refactoring/extractFunction/controlFlow/outputValues/triple.kt.after b/idea/testData/refactoring/extractFunction/controlFlow/outputValues/triple.kt.after index 7e349ce732a..db467fdbd60 100644 --- a/idea/testData/refactoring/extractFunction/controlFlow/outputValues/triple.kt.after +++ b/idea/testData/refactoring/extractFunction/controlFlow/outputValues/triple.kt.after @@ -21,7 +21,12 @@ fun foo(a: Int): Int { return b + c + d } -private fun triple(b: Int, a: Int, c: Int, d: Int): Triple { +private fun triple( + b: Int, + a: Int, + c: Int, + d: Int +): Triple { var b1 = b var c1 = c var d1 = d diff --git a/idea/testData/refactoring/extractFunction/duplicates/branchingMatch1.kt.after b/idea/testData/refactoring/extractFunction/duplicates/branchingMatch1.kt.after index 0c6d71004c0..bce818fc4f8 100644 --- a/idea/testData/refactoring/extractFunction/duplicates/branchingMatch1.kt.after +++ b/idea/testData/refactoring/extractFunction/duplicates/branchingMatch1.kt.after @@ -16,7 +16,7 @@ fun foo1() { val x = 1 var y: Int = x println( - i(x, y) + i(x, y) ) } diff --git a/idea/testData/refactoring/extractFunction/parameters/capturedFunctions/localExtensionFunChainedCalls.kt.after b/idea/testData/refactoring/extractFunction/parameters/capturedFunctions/localExtensionFunChainedCalls.kt.after index 6a2fa11dd48..c8418a85ce1 100644 --- a/idea/testData/refactoring/extractFunction/parameters/capturedFunctions/localExtensionFunChainedCalls.kt.after +++ b/idea/testData/refactoring/extractFunction/parameters/capturedFunctions/localExtensionFunChainedCalls.kt.after @@ -13,5 +13,8 @@ fun foo(n: Int): Int { return i(n, Int::bar1, Int::bar2) } -private fun i(n: Int, bar1: Int.(m: Int) -> Int, bar2: Int.(m: Int) -> Int) = - n.bar1(n + 1).bar2(n + 2) \ No newline at end of file +private fun i( + n: Int, + bar1: Int.(m: Int) -> Int, + bar2: Int.(m: Int) -> Int +) = n.bar1(n + 1).bar2(n + 2) \ No newline at end of file diff --git a/idea/testData/refactoring/extractFunction/typeParameters/typeParametersAndConstraintsCombined1.kt.after b/idea/testData/refactoring/extractFunction/typeParameters/typeParametersAndConstraintsCombined1.kt.after index ad0893c2a0c..348c0fbbb55 100644 --- a/idea/testData/refactoring/extractFunction/typeParameters/typeParametersAndConstraintsCombined1.kt.after +++ b/idea/testData/refactoring/extractFunction/typeParameters/typeParametersAndConstraintsCombined1.kt.after @@ -17,5 +17,8 @@ class A(val t: T) where T: DataEx { } } -private fun i(a: A, b: A.B, v: V) where T : DataEx, U : DataExEx, V : DataEx = - a.t.x + b.u.x + v.x \ No newline at end of file +private fun i( + a: A, + b: A.B, + v: V +) where T : DataEx, U : DataExEx, V : DataEx = a.t.x + b.u.x + v.x \ No newline at end of file diff --git a/idea/testData/refactoring/extractInterface/addImportOnParameterPullUp.kt.after b/idea/testData/refactoring/extractInterface/addImportOnParameterPullUp.kt.after index b554d635a42..5a306f671c8 100644 --- a/idea/testData/refactoring/extractInterface/addImportOnParameterPullUp.kt.after +++ b/idea/testData/refactoring/extractInterface/addImportOnParameterPullUp.kt.after @@ -4,5 +4,5 @@ import foo.Z class C( // INFO: {checked: "true", toAbstract: "true"} - override val z: Z + override val z: Z ) : ISomething diff --git a/idea/testData/refactoring/inline/function/expressionBody/FunctionalParameterPassed.kt b/idea/testData/refactoring/inline/function/expressionBody/FunctionalParameterPassed.kt index da44ba69398..860a47fbc46 100644 --- a/idea/testData/refactoring/inline/function/expressionBody/FunctionalParameterPassed.kt +++ b/idea/testData/refactoring/inline/function/expressionBody/FunctionalParameterPassed.kt @@ -2,7 +2,7 @@ fun foo(p1: String, p2: () -> Boolean) = bar(p1, null, p2) -fun bar(p1: String, p2: String?, p3: () -> Boolean) +fun bar(p1: String, p2: String?, p3: () -> Boolean) = Unit fun foo(i: I) { foo("foo") { diff --git a/idea/testData/refactoring/inline/function/expressionBody/FunctionalParameterPassed.kt.after b/idea/testData/refactoring/inline/function/expressionBody/FunctionalParameterPassed.kt.after index 05adffbe97a..cb7fb4a60f1 100644 --- a/idea/testData/refactoring/inline/function/expressionBody/FunctionalParameterPassed.kt.after +++ b/idea/testData/refactoring/inline/function/expressionBody/FunctionalParameterPassed.kt.after @@ -1,6 +1,6 @@ // COMPILER_ARGUMENTS: -XXLanguage:-NewInference -fun bar(p1: String, p2: String?, p3: () -> Boolean) +fun bar(p1: String, p2: String?, p3: () -> Boolean) = Unit fun foo(i: I) { bar("foo", null) { diff --git a/idea/testData/refactoring/inline/function/fromIntellij/InlineAnonymousClassWithPrivateMethod.kt.after b/idea/testData/refactoring/inline/function/fromIntellij/InlineAnonymousClassWithPrivateMethod.kt.after index ea081d8e7c5..db3cd39c2be 100644 --- a/idea/testData/refactoring/inline/function/fromIntellij/InlineAnonymousClassWithPrivateMethod.kt.after +++ b/idea/testData/refactoring/inline/function/fromIntellij/InlineAnonymousClassWithPrivateMethod.kt.after @@ -10,13 +10,13 @@ object Foo { internal object Bar { @JvmStatic fun main(args: Array) { bar(object : Runnable { - override fun run() { - doRun() - } + override fun run() { + doRun() + } - private fun doRun() { - // Woo-hoo - } - }) + private fun doRun() { + // Woo-hoo + } + }) } } \ No newline at end of file diff --git a/idea/testData/refactoring/inline/function/returnAtEnd/DefaultParameter.kt.after b/idea/testData/refactoring/inline/function/returnAtEnd/DefaultParameter.kt.after index 096a8a85e59..00fda29c9ff 100644 --- a/idea/testData/refactoring/inline/function/returnAtEnd/DefaultParameter.kt.after +++ b/idea/testData/refactoring/inline/function/returnAtEnd/DefaultParameter.kt.after @@ -3,5 +3,6 @@ fun callInDefault(simple: List = provideSimple(), complex: List val result = mutableListOf("statement 1") result.add("statement 2") result -}) { +} +) { } \ No newline at end of file diff --git a/idea/testData/refactoring/introduceLambdaParameter/lambdaParamMultiline.kt.after b/idea/testData/refactoring/introduceLambdaParameter/lambdaParamMultiline.kt.after index b390649e584..82f94176858 100644 --- a/idea/testData/refactoring/introduceLambdaParameter/lambdaParamMultiline.kt.after +++ b/idea/testData/refactoring/introduceLambdaParameter/lambdaParamMultiline.kt.after @@ -7,7 +7,7 @@ fun foo(a: Int, s: String, i: (Int) -> Int): Int { fun test() { foo(1, "2") { a -> a - .plus(1) - .plus(2) + .plus(1) + .plus(2) } } \ No newline at end of file diff --git a/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineBinaryExpression.kt.after b/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineBinaryExpression.kt.after index 342fc53f9cf..f394f7b9dea 100644 --- a/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineBinaryExpression.kt.after +++ b/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineBinaryExpression.kt.after @@ -1,8 +1,10 @@ fun foo(i: Int) { } -fun test(i: () -> Int = { - (1 - + 2) -}) { +fun test( + i: () -> Int = { + (1 + + 2) + } +) { foo(i()) } \ No newline at end of file diff --git a/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineBinaryExpressionWithComments.kt.after b/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineBinaryExpressionWithComments.kt.after index 89f2f50f6d8..85b67ec25f0 100644 --- a/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineBinaryExpressionWithComments.kt.after +++ b/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineBinaryExpressionWithComments.kt.after @@ -1,8 +1,10 @@ fun foo(i: Int) { } -fun test(i: () -> Int = { - (1 // abc - /*def*/ + 2) -}) { +fun test( + i: () -> Int = { + (1 // abc + /*def*/ + 2) + } +) { foo(i()) } \ No newline at end of file diff --git a/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineNestedBinaryExpression1.kt.after b/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineNestedBinaryExpression1.kt.after index 2cc60b16f6a..df085cc3922 100644 --- a/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineNestedBinaryExpression1.kt.after +++ b/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineNestedBinaryExpression1.kt.after @@ -1,8 +1,10 @@ fun foo(i: Int) { } -fun test(i: () -> Int = { - (1 - + 2 - 3) -}) { +fun test( + i: () -> Int = { + (1 + + 2 - 3) + } +) { foo(i()) } \ No newline at end of file diff --git a/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineNestedBinaryExpression2.kt.after b/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineNestedBinaryExpression2.kt.after index 86a45908394..e2a56fd4592 100644 --- a/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineNestedBinaryExpression2.kt.after +++ b/idea/testData/refactoring/introduceLambdaParameter/multiline/multilineNestedBinaryExpression2.kt.after @@ -1,8 +1,10 @@ fun foo(i: Int) { } -fun test(i: () -> Int = { - (1 + 2 - - 3) -}) { +fun test( + i: () -> Int = { + (1 + 2 + - 3) + } +) { foo(i()) } \ No newline at end of file diff --git a/idea/testData/refactoring/introduceLambdaParameter/stringTemplates/rawTemplateWithSubstring.kt.after b/idea/testData/refactoring/introduceLambdaParameter/stringTemplates/rawTemplateWithSubstring.kt.after index 94a910e4aa9..3ca56dfab2e 100644 --- a/idea/testData/refactoring/introduceLambdaParameter/stringTemplates/rawTemplateWithSubstring.kt.after +++ b/idea/testData/refactoring/introduceLambdaParameter/stringTemplates/rawTemplateWithSubstring.kt.after @@ -1,7 +1,9 @@ -fun foo(a: Int, s: (Int) -> String = { a -> - """c$a +fun foo( + a: Int, s: (Int) -> String = { a -> + """c$a :${a + 1}d""" -}): String { + } +): String { val x = """_${s(a)}_""" val y = "_$a:${a + 1}d_" val z = """_c$a:${a + 1}d_""" diff --git a/idea/testData/refactoring/introduceParameter/multiline/multilineBinaryExpression.kt.after b/idea/testData/refactoring/introduceParameter/multiline/multilineBinaryExpression.kt.after index b782cb407cf..b95743b03fb 100644 --- a/idea/testData/refactoring/introduceParameter/multiline/multilineBinaryExpression.kt.after +++ b/idea/testData/refactoring/introduceParameter/multiline/multilineBinaryExpression.kt.after @@ -1,6 +1,8 @@ fun foo(i: Int) { } -fun test(i: Int = (1 - + 2)) { +fun test( + i: Int = (1 + + 2) +) { foo(i) } \ No newline at end of file diff --git a/idea/testData/refactoring/introduceParameter/multiline/multilineBinaryExpressionWithComments.kt.after b/idea/testData/refactoring/introduceParameter/multiline/multilineBinaryExpressionWithComments.kt.after index 4fffbdfb58e..f5e9d8c6785 100644 --- a/idea/testData/refactoring/introduceParameter/multiline/multilineBinaryExpressionWithComments.kt.after +++ b/idea/testData/refactoring/introduceParameter/multiline/multilineBinaryExpressionWithComments.kt.after @@ -1,6 +1,8 @@ fun foo(i: Int) { } -fun test(i: Int = (1 // abc - /*def*/ + 2)) { +fun test( + i: Int = (1 // abc + /*def*/ + 2) +) { foo(i) } \ No newline at end of file diff --git a/idea/testData/refactoring/introduceParameter/multiline/multilineNestedBinaryExpression1.kt.after b/idea/testData/refactoring/introduceParameter/multiline/multilineNestedBinaryExpression1.kt.after index d47e0d33aef..88e3417bd59 100644 --- a/idea/testData/refactoring/introduceParameter/multiline/multilineNestedBinaryExpression1.kt.after +++ b/idea/testData/refactoring/introduceParameter/multiline/multilineNestedBinaryExpression1.kt.after @@ -1,6 +1,8 @@ fun foo(i: Int) { } -fun test(i: Int = (1 - + 2 - 3)) { +fun test( + i: Int = (1 + + 2 - 3) +) { foo(i) } \ No newline at end of file diff --git a/idea/testData/refactoring/introduceParameter/multiline/multilineNestedBinaryExpression2.kt.after b/idea/testData/refactoring/introduceParameter/multiline/multilineNestedBinaryExpression2.kt.after index d662fb497ca..f0d58b57e89 100644 --- a/idea/testData/refactoring/introduceParameter/multiline/multilineNestedBinaryExpression2.kt.after +++ b/idea/testData/refactoring/introduceParameter/multiline/multilineNestedBinaryExpression2.kt.after @@ -1,6 +1,8 @@ fun foo(i: Int) { } -fun test(i: Int = (1 + 2 - - 3)) { +fun test( + i: Int = (1 + 2 + - 3) +) { foo(i) } \ No newline at end of file diff --git a/idea/testData/refactoring/introduceParameter/stringTemplates/rawTemplateWithSubstring.kt.after b/idea/testData/refactoring/introduceParameter/stringTemplates/rawTemplateWithSubstring.kt.after index f6fa52c447a..79f281f8f66 100644 --- a/idea/testData/refactoring/introduceParameter/stringTemplates/rawTemplateWithSubstring.kt.after +++ b/idea/testData/refactoring/introduceParameter/stringTemplates/rawTemplateWithSubstring.kt.after @@ -1,5 +1,7 @@ -fun foo(a: Int, s: String = """c$a - :${a + 1}d"""): String { +fun foo( + a: Int, s: String = """c$a + :${a + 1}d""" +): String { val x = """_${s}_""" val y = "_$a:${a + 1}d_" val z = """_c$a:${a + 1}d_""" diff --git a/idea/testData/refactoring/pullUp/k2j/constructorParameterToClass.kt b/idea/testData/refactoring/pullUp/k2j/constructorParameterToClass.kt index e193caf83e3..8dca401fbb0 100644 --- a/idea/testData/refactoring/pullUp/k2j/constructorParameterToClass.kt +++ b/idea/testData/refactoring/pullUp/k2j/constructorParameterToClass.kt @@ -1,8 +1,8 @@ // WITH_RUNTIME abstract class B( - // INFO: {"checked": "true"} - val n: Int, - // INFO: {"checked": "true"} - val s: String, - val b: Boolean + // INFO: {"checked": "true"} + val n: Int, + // INFO: {"checked": "true"} + val s: String, + val b: Boolean ): A() \ No newline at end of file diff --git a/idea/testData/refactoring/pullUp/k2j/constructorParameterToClass.kt.after b/idea/testData/refactoring/pullUp/k2j/constructorParameterToClass.kt.after index 1f9f578ef8f..6e55c71ab1a 100644 --- a/idea/testData/refactoring/pullUp/k2j/constructorParameterToClass.kt.after +++ b/idea/testData/refactoring/pullUp/k2j/constructorParameterToClass.kt.after @@ -1,6 +1,6 @@ // WITH_RUNTIME abstract class B( - // INFO: {"checked": "true"} - // INFO: {"checked": "true"} - val b: Boolean + // INFO: {"checked": "true"} + // INFO: {"checked": "true"} + val b: Boolean ): A() diff --git a/idea/testData/refactoring/pullUp/k2k/constructorParametersToInterface.kt b/idea/testData/refactoring/pullUp/k2k/constructorParametersToInterface.kt index 2d3e4c57952..a5ef2f9d76a 100644 --- a/idea/testData/refactoring/pullUp/k2k/constructorParametersToInterface.kt +++ b/idea/testData/refactoring/pullUp/k2k/constructorParametersToInterface.kt @@ -1,9 +1,9 @@ interface I class B( - // INFO: {"checked": "true", "toAbstract": "true"} - val s: String, - // INFO: {"checked": "true", "toAbstract": "true"} - val b: Boolean, - val i: Int + // INFO: {"checked": "true", "toAbstract": "true"} + val s: String, + // INFO: {"checked": "true", "toAbstract": "true"} + val b: Boolean, + val i: Int ) : I \ No newline at end of file diff --git a/idea/testData/refactoring/pullUp/k2k/constructorParametersToInterface.kt.after b/idea/testData/refactoring/pullUp/k2k/constructorParametersToInterface.kt.after index a8148f05d62..851641f5e79 100644 --- a/idea/testData/refactoring/pullUp/k2k/constructorParametersToInterface.kt.after +++ b/idea/testData/refactoring/pullUp/k2k/constructorParametersToInterface.kt.after @@ -4,9 +4,9 @@ interface I { } class B( - // INFO: {"checked": "true", "toAbstract": "true"} - override val s: String, - // INFO: {"checked": "true", "toAbstract": "true"} - override val b: Boolean, - val i: Int + // INFO: {"checked": "true", "toAbstract": "true"} + override val s: String, + // INFO: {"checked": "true", "toAbstract": "true"} + override val b: Boolean, + val i: Int ) : I \ No newline at end of file diff --git a/idea/testData/refactoring/pullUp/k2k/constructorParametersToSuperClassAndMakeAbstract.kt b/idea/testData/refactoring/pullUp/k2k/constructorParametersToSuperClassAndMakeAbstract.kt index cfd5d86c361..9f0507daf60 100644 --- a/idea/testData/refactoring/pullUp/k2k/constructorParametersToSuperClassAndMakeAbstract.kt +++ b/idea/testData/refactoring/pullUp/k2k/constructorParametersToSuperClassAndMakeAbstract.kt @@ -3,9 +3,9 @@ open class A(n: Int) { } class B( - // INFO: {"checked": "true", "toAbstract": "true"} - val s: String, - // INFO: {"checked": "true", "toAbstract": "true"} - val b: Boolean, - val i: Int + // INFO: {"checked": "true", "toAbstract": "true"} + val s: String, + // INFO: {"checked": "true", "toAbstract": "true"} + val b: Boolean, + val i: Int ) : A(1) \ No newline at end of file diff --git a/idea/testData/refactoring/pullUp/k2k/constructorParametersToSuperClassAndMakeAbstract.kt.after b/idea/testData/refactoring/pullUp/k2k/constructorParametersToSuperClassAndMakeAbstract.kt.after index 644bd567248..09a6bfc3a5d 100644 --- a/idea/testData/refactoring/pullUp/k2k/constructorParametersToSuperClassAndMakeAbstract.kt.after +++ b/idea/testData/refactoring/pullUp/k2k/constructorParametersToSuperClassAndMakeAbstract.kt.after @@ -5,9 +5,9 @@ abstract class A(n: Int) { } class B( - // INFO: {"checked": "true", "toAbstract": "true"} - override val s: String, - // INFO: {"checked": "true", "toAbstract": "true"} - override val b: Boolean, - val i: Int + // INFO: {"checked": "true", "toAbstract": "true"} + override val s: String, + // INFO: {"checked": "true", "toAbstract": "true"} + override val b: Boolean, + val i: Int ) : A(1) \ No newline at end of file diff --git a/idea/testData/refactoring/pullUp/k2k/fromClassToClassWithGenerics.kt.after b/idea/testData/refactoring/pullUp/k2k/fromClassToClassWithGenerics.kt.after index ebba3d5bb5d..020d292e91f 100644 --- a/idea/testData/refactoring/pullUp/k2k/fromClassToClassWithGenerics.kt.after +++ b/idea/testData/refactoring/pullUp/k2k/fromClassToClassWithGenerics.kt.after @@ -34,7 +34,8 @@ abstract class A(x: T, y: Any?) { } // INFO: {"checked": "true"} - inner class Foo(x1: T, x2: Z, y1: Any?, y2: Z, w1: I, w2: Z, s1: S, s2: Z): A>(), Z { + inner class Foo(x1: T, x2: Z, y1: Any?, y2: Z, w1: I, w2: Z, s1: S, s2: Z): A>(), + Z { } } diff --git a/idea/tests/org/jetbrains/kotlin/idea/codeInsight/smartEnter/SmartEnterTest.kt b/idea/tests/org/jetbrains/kotlin/idea/codeInsight/smartEnter/SmartEnterTest.kt index 46d033ca75e..0b421c08ec1 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/codeInsight/smartEnter/SmartEnterTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/codeInsight/smartEnter/SmartEnterTest.kt @@ -18,8 +18,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testIfCondition() = doFunTest( """ if - """ - , + """, """ if () { } @@ -29,8 +28,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testIfCondition2() = doFunTest( """ if - """ - , + """, """ if () { } @@ -42,8 +40,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { if return true - """ - , + """, """ if () { } @@ -55,8 +52,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testIfCondition3() = doFunTest( """ if ( - """ - , + """, """ if () { } @@ -67,8 +63,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ if (true) { } - """ - , + """, """ if (true) { @@ -79,8 +74,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testIfCondition5() = doFunTest( """ if (true) { - """ - , + """, """ if (true) { @@ -93,8 +87,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { if (true) { println() } - """ - , + """, """ if (true) { @@ -106,8 +99,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testIfThenOneLine1() = doFunTest( """ if (true) println() - """ - , + """, """ if (true) println() @@ -117,8 +109,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testIfThenOneLine2() = doFunTest( """ if (true) println() - """ - , + """, """ if (true) println() @@ -129,8 +120,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ if (true) println() - """ - , + """, """ if (true) println() @@ -142,8 +132,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ if (true) println() - """ - , + """, """ if (true) println() @@ -156,8 +145,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ if (true) println() - """ - , + """, """ if (true) { @@ -261,8 +249,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testWhile() = doFunTest( """ while - """ - , + """, """ while () { } @@ -272,8 +259,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testWhile2() = doFunTest( """ while - """ - , + """, """ while () { } @@ -283,8 +269,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testWhile3() = doFunTest( """ while ( - """ - , + """, """ while () { } @@ -295,8 +280,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ while (true) { } - """ - , + """, """ while (true) { @@ -307,8 +291,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testWhile5() = doFunTest( """ while (true) { - """ - , + """, """ while (true) { @@ -321,8 +304,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { while (true) { println() } - """ - , + """, """ while (true) { @@ -379,8 +361,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testForStatement() = doFunTest( """ for - """ - , + """, """ for () { } @@ -390,8 +371,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testForStatement2() = doFunTest( """ for - """ - , + """, """ for () { } @@ -402,8 +382,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ for (i in 1..10) { } - """ - , + """, """ for (i in 1..10) { @@ -414,8 +393,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testForStatement5() = doFunTest( """ for (i in 1..10) { - """ - , + """, """ for (i in 1..10) { @@ -428,8 +406,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { for (i in 1..10) { println() } - """ - , + """, """ for (i in 1..10) { @@ -441,8 +418,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testForStatementSingle() = doFunTest( """ for (i in 1..10) println() - """ - , + """, """ for (i in 1..10) println() @@ -452,8 +428,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testForStatementSingleEmpty() = doFunTest( """ for () println() - """ - , + """, """ for () println() """ @@ -463,8 +438,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ for (some) println() - """ - , + """, """ for (some) { @@ -501,8 +475,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testWhen() = doFunTest( """ when - """ - , + """, """ when { @@ -513,8 +486,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testWhen1() = doFunTest( """ when - """ - , + """, """ when { @@ -526,8 +498,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ when (true) { } - """ - , + """, """ when (true) { @@ -538,8 +509,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testWhen3() = doFunTest( """ when (true) { - """ - , + """, """ when (true) { @@ -552,8 +522,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { when (true) { false -> println("false") } - """ - , + """, """ when (true) { @@ -565,8 +534,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testWhen5() = doFunTest( """ when () - """ - , + """, """ when () { } @@ -576,8 +544,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testWhen6() = doFunTest( """ when (true) - """ - , + """, """ when (true) { @@ -590,8 +557,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ when ({ } - """ - , + """, """ when ({ @@ -602,8 +568,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testDoWhile() = doFunTest( """ do - """ - , + """, """ do { } while ()${' '} @@ -613,8 +578,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testDoWhile2() = doFunTest( """ do - """ - , + """, """ do { } while () @@ -626,8 +590,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { do { println(hi) } - """ - , + """, """ do { println(hi) @@ -639,8 +602,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ do { } while () - """ - , + """, """ do { } while () @@ -651,8 +613,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ do { } while (true) - """ - , + """, """ do { @@ -664,8 +625,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ do { } while (true) - """ - , + """, """ do { @@ -677,8 +637,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ do { } while (true) - """ - , + """, """ do { @@ -689,8 +648,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testDoWhile9() = doFunTest( """ do while - """ - , + """, """ do { } while () @@ -700,8 +658,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testDoWhile10() = doFunTest( """ do while (true) - """ - , + """, """ do { @@ -714,8 +671,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { do { println("some") } while - """ - , + """, """ do { println("some") @@ -728,8 +684,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { do { println("some") } while (true - """ - , + """, """ do { @@ -742,8 +697,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ do println("some") - """ - , + """, """ do { println("some") @@ -755,8 +709,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ do println("some") - """ - , + """, """ do { println("some") @@ -768,8 +721,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ do println("some") while (true) println("hi") - """ - , + """, """ do println("some") while (true) @@ -781,8 +733,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ do println("some") while (true) println("hi") - """ - , + """, """ do println("some") while (true) @@ -835,8 +786,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testFunBody() = doFileTest( """ fun test() - """ - , + """, """ fun test() { @@ -847,8 +797,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testFunBody1() = doFileTest( """ fun test - """ - , + """, """ fun test() { @@ -859,8 +808,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testFunBody2() = doFileTest( """ fun (p: Int, s: String - """ - , + """, """ fun(p: Int, s: String) { @@ -873,8 +821,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { interface Some { fun (p: Int) } - """ - , + """, """ interface Some { fun(p: Int) @@ -888,8 +835,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { class Some { abstract fun (p: Int) } - """ - , + """, """ class Some { abstract fun(p: Int) @@ -903,8 +849,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { class Some { fun test(p: Int) = 1 } - """ - , + """, """ class Some { fun test(p: Int) = 1 @@ -917,8 +862,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ fun test(p: Int) { } - """ - , + """, """ fun test(p: Int) { @@ -1017,8 +961,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ var a : Int = 0 set - """ - , + """, """ var a : Int = 0 set @@ -1030,8 +973,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ var a : Int = 0 set( - """ - , + """, """ var a : Int = 0 set(value) { @@ -1044,8 +986,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ var a : Int = 0 set() - """ - , + """, """ var a : Int = 0 set(value) { @@ -1058,8 +999,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ var a : Int = 0 set(v) - """ - , + """, """ var a : Int = 0 set(v) { @@ -1073,8 +1013,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { var a : Int = 0 set() { } - """ - , + """, """ var a : Int = 0 set(value) { @@ -1088,8 +1027,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { var a : Int = 0 set(v) { } - """ - , + """, """ var a : Int = 0 set(v) { @@ -1102,8 +1040,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ var a : Int = 0 set(value){} - """ - , + """, """ var a : Int = 0 set(value) {} @@ -1115,8 +1052,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ var a : Int = 0 private set - """ - , + """, """ var a : Int = 0 private set @@ -1128,8 +1064,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ var a : Int = 0 private set( - """ - , + """, """ var a : Int = 0 private set(value) { @@ -1142,8 +1077,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ var a : Int = 0 private set() - """ - , + """, """ var a : Int = 0 private set(value) { @@ -1156,8 +1090,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ var a : Int = 0 private set(v) - """ - , + """, """ var a : Int = 0 private set(v) { @@ -1171,8 +1104,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { var a : Int = 0 private set() { } - """ - , + """, """ var a : Int = 0 private set(value) { @@ -1186,8 +1118,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { var a : Int = 0 private set(v) { } - """ - , + """, """ var a : Int = 0 private set(v) { @@ -1199,8 +1130,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testTryBody() = doFunTest( """ try - """ - , + """, """ try { @@ -1212,8 +1142,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ try { } catch(e: Exception) - """ - , + """, """ try { } catch (e: Exception) { @@ -1226,8 +1155,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ try { } catch - """ - , + """, """ try { } catch () { @@ -1239,8 +1167,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ try { } catch( - """ - , + """, """ try { } catch () { @@ -1252,8 +1179,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ try { } catch( {} - """ - , + """, """ try { } catch () { @@ -1265,8 +1191,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ try { } catch(e: Exception - """ - , + """, """ try { } catch (e: Exception) { @@ -1280,8 +1205,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { try { } catch(e: Exception) { } finally - """ - , + """, """ try { } catch (e: Exception) { @@ -1298,8 +1222,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun test() { foo(Any()) } - """ - , + """, """ fun foo(a: Any, block: () -> Unit) { } @@ -1316,8 +1239,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun test() { foo(Any()) } - """ - , + """, """ fun foo(a: Any, block: Any.() -> Unit) { } @@ -1332,8 +1254,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { class Foo { init } - """ - , + """, """ class Foo { init { @@ -1346,8 +1267,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testClassBody1() = doFileTest( """ class Foo - """ - , + """, """ class Foo { @@ -1358,8 +1278,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { fun testClassBody2() = doFileTest( """ class Foo - """ - , + """, """ class Foo { @@ -1371,8 +1290,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ interface I val a = object : I - """ - , + """, """ interface I val a = object : I { @@ -1387,8 +1305,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { val a = object : I val b = "" - """ - , + """, """ interface I val a = object : I { @@ -1403,8 +1320,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ open class A class B : A() - """ - , + """, """ open class A class B : A() { @@ -1417,8 +1333,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ open class A class B : A - """ - , + """, """ open class A class B : A() { @@ -1431,8 +1346,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ sealed class A(val s: String) class B : A - """ - , + """, """ sealed class A(val s: String) class B : A() { @@ -1447,8 +1361,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { interface J abstract class A class B : I, A, J - """ - , + """, """ interface I interface J @@ -1522,7 +1435,7 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() { """ fun foo(i: Int) = 1 fun test4() { - foo(1, ) + foo(1,) } """ ) diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiFileTest.kt b/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiFileTest.kt index 3dd144704e6..473b9f9f1bc 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiFileTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiFileTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -12,7 +12,6 @@ import com.intellij.codeInsight.intention.IntentionAction import com.intellij.codeInspection.InspectionEP import com.intellij.codeInspection.LocalInspectionEP import com.intellij.ide.highlighter.JavaFileType -import com.intellij.openapi.command.CommandProcessor import com.intellij.openapi.editor.Editor import com.intellij.openapi.fileTypes.FileType import com.intellij.openapi.fileTypes.PlainTextFileType @@ -31,6 +30,7 @@ import org.jetbrains.kotlin.idea.quickfix.utils.findInspectionFile import org.jetbrains.kotlin.idea.test.DirectiveBasedActionUtils import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase import org.jetbrains.kotlin.idea.test.withCustomCompilerOptions +import org.jetbrains.kotlin.idea.util.application.executeCommand import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.test.Directives import org.jetbrains.kotlin.test.KotlinTestUtils @@ -133,64 +133,60 @@ abstract class AbstractQuickFixMultiFileTest : KotlinLightCodeInsightFixtureTest configureMultiFileTest(subFiles, beforeFile) withCustomCompilerOptions(multiFileText, project, module) { - CommandProcessor.getInstance().executeCommand( - project, - { - try { - val psiFile = file + project.executeCommand("") { + try { + val psiFile = file - val actionHint = ActionHint.parse(psiFile, beforeFile.content) - val text = actionHint.expectedText + val actionHint = ActionHint.parse(psiFile, beforeFile.content) + val text = actionHint.expectedText - val actionShouldBeAvailable = actionHint.shouldPresent() + val actionShouldBeAvailable = actionHint.shouldPresent() - if (psiFile is KtFile) { - DirectiveBasedActionUtils.checkForUnexpectedErrors(psiFile) - } - - doAction( - text, - file, - editor, - actionShouldBeAvailable, - getTestName(false), - this::availableActions, - myFixture::doHighlighting, - ) - - val actualText = file.text - val afterText = StringBuilder(actualText).insert(editor.caretModel.offset, "").toString() - - if (actionShouldBeAvailable) { - TestCase.assertNotNull(".after file should exist", afterFile) - if (afterText != afterFile!!.content) { - val actualTestFile = StringBuilder() - if (multiFileText.startsWith("// LANGUAGE_VERSION")) { - actualTestFile.append(multiFileText.lineSequence().first()) - } - - actualTestFile.append("// FILE: ").append(beforeFile.path).append("\n").append(beforeFile.content) - for (file in subFiles) { - actualTestFile.append("// FILE: ").append(file.path).append("\n").append(file.content) - } - actualTestFile.append("// FILE: ").append(afterFile.path).append("\n").append(afterText) - - KotlinTestUtils.assertEqualsToFile(File(beforeFileName), actualTestFile.toString()) - } - } else { - TestCase.assertNull(".after file should not exist", afterFile) - } - } catch (e: ComparisonFailure) { - throw e - } catch (e: AssertionError) { - throw e - } catch (e: Throwable) { - e.printStackTrace() - TestCase.fail(getTestName(true)) + if (psiFile is KtFile) { + DirectiveBasedActionUtils.checkForUnexpectedErrors(psiFile) } - }, - "", "", - ) + + doAction( + text, + file, + editor, + actionShouldBeAvailable, + getTestName(false), + this::availableActions, + myFixture::doHighlighting, + ) + + val actualText = file.text + val afterText = StringBuilder(actualText).insert(editor.caretModel.offset, "").toString() + + if (actionShouldBeAvailable) { + TestCase.assertNotNull(".after file should exist", afterFile) + if (afterText != afterFile!!.content) { + val actualTestFile = StringBuilder() + if (multiFileText.startsWith("// LANGUAGE_VERSION")) { + actualTestFile.append(multiFileText.lineSequence().first()) + } + + actualTestFile.append("// FILE: ").append(beforeFile.path).append("\n").append(beforeFile.content) + for (file in subFiles) { + actualTestFile.append("// FILE: ").append(file.path).append("\n").append(file.content) + } + actualTestFile.append("// FILE: ").append(afterFile.path).append("\n").append(afterText) + + KotlinTestUtils.assertEqualsToFile(File(beforeFileName), actualTestFile.toString()) + } + } else { + TestCase.assertNull(".after file should not exist", afterFile) + } + } catch (e: ComparisonFailure) { + throw e + } catch (e: AssertionError) { + throw e + } catch (e: Throwable) { + e.printStackTrace() + TestCase.fail(getTestName(true)) + } + } } } @@ -214,69 +210,65 @@ abstract class AbstractQuickFixMultiFileTest : KotlinLightCodeInsightFixtureTest myFixture.configureByFiles(*testFiles.toTypedArray()) withCustomCompilerOptions(originalFileText, project, module) { - CommandProcessor.getInstance().executeCommand( - project, - { - try { - val psiFile = file + project.executeCommand("") { + try { + val psiFile = file - val actionHint = ActionHint.parse(psiFile, originalFileText) - val text = actionHint.expectedText + val actionHint = ActionHint.parse(psiFile, originalFileText) + val text = actionHint.expectedText - val actionShouldBeAvailable = actionHint.shouldPresent() + val actionShouldBeAvailable = actionHint.shouldPresent() - if (psiFile is KtFile) { - DirectiveBasedActionUtils.checkForUnexpectedErrors(psiFile) - } - - doAction( - text, - file, - editor, - actionShouldBeAvailable, - beforeFileName, - this::availableActions, - myFixture::doHighlighting, - ) - - if (actionShouldBeAvailable) { - val afterFilePath = beforeFileName.replace(".before.Main.", ".after.") - try { - myFixture.checkResultByFile(mainFile.name.replace(".before.Main.", ".after.")) - } catch (e: ComparisonFailure) { - KotlinTestUtils.assertEqualsToFile(File(afterFilePath), editor) - } - - for (file in myFixture.file.containingDirectory.files) { - val fileName = file.name - if (fileName == myFixture.file.name || !fileName.startsWith( - extraFileNamePrefix( - myFixture.file - .name, - ), - ) - ) continue - - val extraFileFullPath = beforeFileName.replace(myFixture.file.name, fileName) - val afterFile = File(extraFileFullPath.replace(".before.", ".after.")) - if (afterFile.exists()) { - KotlinTestUtils.assertEqualsToFile(afterFile, file.text) - } else { - KotlinTestUtils.assertEqualsToFile(File(extraFileFullPath), file.text) - } - } - } - } catch (e: ComparisonFailure) { - throw e - } catch (e: AssertionError) { - throw e - } catch (e: Throwable) { - e.printStackTrace() - TestCase.fail(getTestName(true)) + if (psiFile is KtFile) { + DirectiveBasedActionUtils.checkForUnexpectedErrors(psiFile) } - }, - "", "", - ) + + doAction( + text, + file, + editor, + actionShouldBeAvailable, + beforeFileName, + this::availableActions, + myFixture::doHighlighting, + ) + + if (actionShouldBeAvailable) { + val afterFilePath = beforeFileName.replace(".before.Main.", ".after.") + try { + myFixture.checkResultByFile(mainFile.name.replace(".before.Main.", ".after.")) + } catch (e: ComparisonFailure) { + KotlinTestUtils.assertEqualsToFile(File(afterFilePath), editor) + } + + for (file in myFixture.file.containingDirectory.files) { + val fileName = file.name + if (fileName == myFixture.file.name || !fileName.startsWith( + extraFileNamePrefix( + myFixture.file + .name, + ), + ) + ) continue + + val extraFileFullPath = beforeFileName.replace(myFixture.file.name, fileName) + val afterFile = File(extraFileFullPath.replace(".before.", ".after.")) + if (afterFile.exists()) { + KotlinTestUtils.assertEqualsToFile(afterFile, file.text) + } else { + KotlinTestUtils.assertEqualsToFile(File(extraFileFullPath), file.text) + } + } + } + } catch (e: ComparisonFailure) { + throw e + } catch (e: AssertionError) { + throw e + } catch (e: Throwable) { + e.printStackTrace() + TestCase.fail(getTestName(true)) + } + } } } diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiModuleTest.kt b/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiModuleTest.kt index 068fa2dd509..a17c57cc847 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiModuleTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiModuleTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -8,7 +8,6 @@ package org.jetbrains.kotlin.idea.quickfix import com.intellij.codeInsight.daemon.quickFix.ActionHint import com.intellij.codeInsight.daemon.quickFix.LightQuickFixTestCase import com.intellij.codeInsight.intention.IntentionAction -import com.intellij.openapi.command.CommandProcessor import com.intellij.testFramework.UsefulTestCase import junit.framework.ComparisonFailure import junit.framework.TestCase @@ -19,6 +18,7 @@ import org.jetbrains.kotlin.idea.test.DirectiveBasedActionUtils import org.jetbrains.kotlin.idea.test.PluginTestCaseBase import org.jetbrains.kotlin.idea.test.allKotlinFiles import org.jetbrains.kotlin.idea.test.findFileWithCaret +import org.jetbrains.kotlin.idea.util.application.executeCommand import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.test.InTextDirectivesUtils import org.jetbrains.kotlin.test.KotlinTestUtils @@ -43,7 +43,7 @@ abstract class AbstractQuickFixMultiModuleTest : AbstractMultiModuleTest(), Quic val inspections = parseInspectionsToEnable(virtualFile.path, actionFileText).toTypedArray() enableInspectionTools(*inspections) - CommandProcessor.getInstance().executeCommand(project, { + project.executeCommand("") { var expectedErrorMessage = "" try { val actionHint = ActionHint.parse(actionFile, actionFileText) @@ -51,15 +51,24 @@ abstract class AbstractQuickFixMultiModuleTest : AbstractMultiModuleTest(), Quic val actionShouldBeAvailable = actionHint.shouldPresent() - expectedErrorMessage = InTextDirectivesUtils.findListWithPrefixes(actionFileText, "// SHOULD_FAIL_WITH: ") - .joinToString(separator = "\n") + expectedErrorMessage = InTextDirectivesUtils.findListWithPrefixes( + actionFileText, + "// SHOULD_FAIL_WITH: " + ).joinToString(separator = "\n") TypeAccessibilityChecker.testLog = StringBuilder() val log = try { AbstractQuickFixMultiFileTest.doAction( - text, file, editor, actionShouldBeAvailable, actionFileName, this::availableActions, this::doHighlighting, + text, + file, + editor, + actionShouldBeAvailable, + actionFileName, + this::availableActions, + this::doHighlighting, InTextDirectivesUtils.isDirectiveDefined(actionFile.text, "// SHOULD_BE_AVAILABLE_AFTER_EXECUTION") ) + TypeAccessibilityChecker.testLog.toString() } finally { TypeAccessibilityChecker.testLog = null @@ -94,7 +103,7 @@ abstract class AbstractQuickFixMultiModuleTest : AbstractMultiModuleTest(), Quic compareToExpected(dirPath) } } - }, "", "") + } } private fun compareToExpected(directory: String) { diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixTest.kt b/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixTest.kt index e5d0eea5c92..5f8662d3d05 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -41,13 +41,11 @@ abstract class AbstractQuickFixTest : KotlinLightCodeInsightFixtureTestCase(), Q """.trimIndent() ) - private fun unwrapIntention(action: Any): Any { - return when (action) { - is IntentionActionDelegate -> unwrapIntention(action.delegate) - is IntentionActionWrapper -> unwrapIntention(action.delegate) - is QuickFixWrapper -> unwrapIntention(action.fix) - else -> action - } + private fun unwrapIntention(action: Any): Any = when (action) { + is IntentionActionDelegate -> unwrapIntention(action.delegate) + is IntentionActionWrapper -> unwrapIntention(action.delegate) + is QuickFixWrapper -> unwrapIntention(action.fix) + else -> action } } @@ -67,29 +65,30 @@ abstract class AbstractQuickFixTest : KotlinLightCodeInsightFixtureTestCase(), Q } } - override fun getProjectDescriptor(): LightProjectDescriptor { + override fun getProjectDescriptor(): LightProjectDescriptor = if ("createfromusage" in testDataPath.toLowerCase()) { - return KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE + KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE + } else { + super.getProjectDescriptor() } - return super.getProjectDescriptor() - } override val captureExceptions: Boolean get() = false - fun shouldBeAvailableAfterExecution(): Boolean { - return InTextDirectivesUtils.isDirectiveDefined(myFixture.file.text, "// SHOULD_BE_AVAILABLE_AFTER_EXECUTION") - } + private fun shouldBeAvailableAfterExecution(): Boolean = InTextDirectivesUtils.isDirectiveDefined( + myFixture.file.text, + "// SHOULD_BE_AVAILABLE_AFTER_EXECUTION" + ) protected open fun configExtra(options: String) { } private fun getPathAccordingToPackage(name: String, text: String): String { - val packagePath = text.lines().let { it.find { it.trim().startsWith("package") } } + val packagePath = text.lines().let { list -> list.find { it.trim().startsWith("package") } } ?.removePrefix("package") ?.trim()?.replace(".", "/") ?: "" - return packagePath + "/" + name + return "$packagePath/$name" } private fun doKotlinQuickFixTest(beforeFileName: String) { @@ -212,13 +211,13 @@ abstract class AbstractQuickFixTest : KotlinLightCodeInsightFixtureTestCase(), Q if (actionHint.expectedText.startsWith(prefix)) { val className = actionHint.expectedText.substring(prefix.length) val aClass = Class.forName(className) - assert(IntentionAction::class.java.isAssignableFrom(aClass)) { className + " should be inheritor of IntentionAction" } + assert(IntentionAction::class.java.isAssignableFrom(aClass)) { "$className should be inheritor of IntentionAction" } val validActions = HashSet(InTextDirectivesUtils.findLinesWithPrefixesRemoved(text, "// ACTION:")) actions.removeAll { action -> !aClass.isAssignableFrom(action.javaClass) || validActions.contains(action.text) } - if (!actions.isEmpty()) { + if (actions.isNotEmpty()) { Assert.fail("Unexpected intention actions present\n " + actions.map { action -> action.javaClass.toString() + " " + action.toString() + "\n" } @@ -237,7 +236,7 @@ abstract class AbstractQuickFixTest : KotlinLightCodeInsightFixtureTestCase(), Q } } - fun findActionWithText(text: String): IntentionAction? { + private fun findActionWithText(text: String): IntentionAction? { val intentions = myFixture.availableIntentions.filter { it.text == text } if (intentions.isNotEmpty()) return intentions.first() @@ -260,18 +259,16 @@ abstract class AbstractQuickFixTest : KotlinLightCodeInsightFixtureTestCase(), Q return null } - fun checkForUnexpectedErrors() { - DirectiveBasedActionUtils.checkForUnexpectedErrors(myFixture.file as KtFile) - } + private fun checkForUnexpectedErrors() = DirectiveBasedActionUtils.checkForUnexpectedErrors(myFixture.file as KtFile) override fun getTestDataPath(): String { // Ensure full path is returned. Otherwise FileComparisonFailureException does not provide link to file diff val testDataPath = super.getTestDataPath() - try { - return File(testDataPath).getCanonicalPath() + return try { + File(testDataPath).canonicalPath } catch (e: IOException) { e.printStackTrace() - return testDataPath + testDataPath } } diff --git a/idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureTest.kt b/idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureTest.kt index ee08e6fcb4f..03200d42eb4 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureTest.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.idea.refactoring.changeSignature +import com.intellij.application.options.CodeStyle import com.intellij.codeInsight.TargetElementUtil import com.intellij.codeInsight.TargetElementUtil.ELEMENT_NAME_ACCEPTED import com.intellij.codeInsight.TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED @@ -62,18 +63,23 @@ class KotlinChangeSignatureTest : KotlinLightCodeInsightFixtureTestCase() { override fun getProjectDescriptor(): LightProjectDescriptor = KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE + override fun setUp() { + super.setUp() + CodeStyle.getSettings(project).clearCodeStyleSettings() + } + override fun tearDown() { files = emptyList() psiFiles = PsiFile.EMPTY_ARRAY super.tearDown() } - lateinit var files: List - lateinit var psiFiles: Array + private lateinit var files: List + private lateinit var psiFiles: Array private fun findCallers(method: PsiMethod): LinkedHashSet { - val root = KotlinMethodNode(method, HashSet(), project, Runnable { }) - return (0..root.childCount - 1).flatMapTo(LinkedHashSet()) { + val root = KotlinMethodNode(method, HashSet(), project) { } + return (0 until root.childCount).flatMapTo(LinkedHashSet()) { (root.getChildAt(it) as KotlinMethodNode).member.toLightMethods() } } @@ -83,7 +89,7 @@ class KotlinChangeSignatureTest : KotlinLightCodeInsightFixtureTestCase() { var i = 0 indexLoop@ while (true) { for (extension in EXTENSIONS) { - val extraFileName = getTestName(false) + "Before" + (if (i > 0) "." + i else "") + extension + val extraFileName = getTestName(false) + "Before" + (if (i > 0) ".$i" else "") + extension val extraFile = File(testDataPath + extraFileName) if (extraFile.exists()) { fileList.add(extraFileName) @@ -159,7 +165,7 @@ class KotlinChangeSignatureTest : KotlinLightCodeInsightFixtureTestCase() { val project = method.project var newName = method.name - var newReturnType = method.returnType ?: PsiType.VOID + var newReturnType: PsiType = method.returnType ?: PsiType.VOID val newParameters = ArrayList() val parameterPropagationTargets = LinkedHashSet() @@ -343,7 +349,7 @@ class KotlinChangeSignatureTest : KotlinLightCodeInsightFixtureTestCase() { } fun testGenericFunctions() { - doTest() { + doTest { newVisibility = Visibilities.PUBLIC newParameters[0].name = "_x1" @@ -618,9 +624,10 @@ class KotlinChangeSignatureTest : KotlinLightCodeInsightFixtureTestCase() { fun testFqNameShortening() { doTest { - val newParameter = KotlinParameterInfo(originalBaseFunctionDescriptor, -1, "s", KotlinTypeInfo(false, BUILT_INS.anyType)).apply { - currentTypeInfo = KotlinTypeInfo(false, null, "kotlin.String") - } + val newParameter = + KotlinParameterInfo(originalBaseFunctionDescriptor, -1, "s", KotlinTypeInfo(false, BUILT_INS.anyType)).apply { + currentTypeInfo = KotlinTypeInfo(false, null, "kotlin.String") + } addParameter(newParameter) } } @@ -936,7 +943,7 @@ class KotlinChangeSignatureTest : KotlinLightCodeInsightFixtureTestCase() { doTest { newParameters[1].name = "b" } } - fun testConvertParameterToReceiverAddParens() { + fun testConvertParameterToReceiverAddParents() { doTest { receiverParameterInfo = newParameters[0] } } @@ -1126,7 +1133,8 @@ class KotlinChangeSignatureTest : KotlinLightCodeInsightFixtureTestCase() { ) ) - primaryPropagationTargets = listOf(KotlinTopLevelFunctionFqnNameIndex.getInstance().get("bar", project, project.allScope()).first()) + primaryPropagationTargets = + listOf(KotlinTopLevelFunctionFqnNameIndex.getInstance().get("bar", project, project.allScope()).first()) } } @@ -1144,7 +1152,8 @@ class KotlinChangeSignatureTest : KotlinLightCodeInsightFixtureTestCase() { ) ) - primaryPropagationTargets = listOf(KotlinTopLevelFunctionFqnNameIndex.getInstance().get("bar", project, project.allScope()).first()) + primaryPropagationTargets = + listOf(KotlinTopLevelFunctionFqnNameIndex.getInstance().get("bar", project, project.allScope()).first()) } } @@ -1182,7 +1191,8 @@ class KotlinChangeSignatureTest : KotlinLightCodeInsightFixtureTestCase() { ) ) - primaryPropagationTargets = listOf(KotlinTopLevelFunctionFqnNameIndex.getInstance().get("bar", project, project.allScope()).first()) + primaryPropagationTargets = + listOf(KotlinTopLevelFunctionFqnNameIndex.getInstance().get("bar", project, project.allScope()).first()) } } @@ -1491,7 +1501,7 @@ class KotlinChangeSignatureTest : KotlinLightCodeInsightFixtureTestCase() { fun testReturnTypeViaCodeFragment() { doTest { newName = "bar" - newReturnTypeInfo = resolveType("A", true, true) + newReturnTypeInfo = resolveType("A", isCovariant = true, forPreview = true) } } diff --git a/idea/tests/org/jetbrains/kotlin/idea/stubs/AbstractMultiModuleTest.kt b/idea/tests/org/jetbrains/kotlin/idea/stubs/AbstractMultiModuleTest.kt index 83e786e2ab9..8559870464d 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/stubs/AbstractMultiModuleTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/stubs/AbstractMultiModuleTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -23,12 +23,13 @@ import com.intellij.openapi.vfs.VfsUtil import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess import com.intellij.psi.PsiFile import com.intellij.testFramework.PsiTestUtil -import org.jetbrains.kotlin.config.* +import org.jetbrains.kotlin.config.CompilerSettings +import org.jetbrains.kotlin.config.KotlinFacetSettings +import org.jetbrains.kotlin.config.KotlinFacetSettingsProvider +import org.jetbrains.kotlin.config.LanguageFeature import org.jetbrains.kotlin.idea.facet.getOrCreateFacet import org.jetbrains.kotlin.idea.facet.initializeIfNeeded -import org.jetbrains.kotlin.idea.test.ConfigLibraryUtil -import org.jetbrains.kotlin.idea.test.KotlinJdkAndLibraryProjectDescriptor -import org.jetbrains.kotlin.idea.test.PluginTestCaseBase +import org.jetbrains.kotlin.idea.test.* import org.jetbrains.kotlin.platform.TargetPlatform import org.jetbrains.kotlin.test.KotlinTestUtils import org.jetbrains.kotlin.test.TestJdkKind @@ -41,6 +42,7 @@ abstract class AbstractMultiModuleTest : DaemonAnalyzerTestCase() { override fun setUp() { super.setUp() + enableKotlinOfficialCodeStyle(project) VfsRootAccess.allowRootAccess(KotlinTestUtils.getHomeDirectory()) } @@ -62,6 +64,7 @@ abstract class AbstractMultiModuleTest : DaemonAnalyzerTestCase() { override fun tearDown() { VfsRootAccess.disallowRootAccess(KotlinTestUtils.getHomeDirectory()) + disableKotlinOfficialCodeStyle(project) super.tearDown() } diff --git a/j2k/testData/fileOrElement/annotations/annotationDefault.kt b/j2k/testData/fileOrElement/annotations/annotationDefault.kt index e6d6de42913..26bb49797aa 100644 --- a/j2k/testData/fileOrElement/annotations/annotationDefault.kt +++ b/j2k/testData/fileOrElement/annotations/annotationDefault.kt @@ -1,6 +1,16 @@ import kotlin.reflect.KClass -annotation class Ann(val i: Int = 1, val i2: IntArray = [1], val i3: IntArray = [1], val klass: KClass<*> = A::class, val klass2: Array> = [A::class], val klass3: Array> = [A::class], val ann: Inner = Inner(), val ann2: Array = [Inner()], val ann3: Array = [Inner(), Inner()]) +annotation class Ann( + val i: Int = 1, + val i2: IntArray = [1], + val i3: IntArray = [1], + val klass: KClass<*> = A::class, + val klass2: Array> = [A::class], + val klass3: Array> = [A::class], + val ann: Inner = Inner(), + val ann2: Array = [Inner()], + val ann3: Array = [Inner(), Inner()] +) class A annotation class Inner diff --git a/j2k/testData/fileOrElement/annotations/annotationFromConstructorParamToProperty.kt b/j2k/testData/fileOrElement/annotations/annotationFromConstructorParamToProperty.kt index 7d881336a79..bfc1dfadcbe 100644 --- a/j2k/testData/fileOrElement/annotations/annotationFromConstructorParamToProperty.kt +++ b/j2k/testData/fileOrElement/annotations/annotationFromConstructorParamToProperty.kt @@ -2,5 +2,7 @@ internal annotation class A internal annotation class B -class U(@param:A @field:B - var i: Int) \ No newline at end of file +class U( + @param:A @field:B + var i: Int +) \ No newline at end of file diff --git a/j2k/testData/fileOrElement/annotations/annotationInterface1.kt b/j2k/testData/fileOrElement/annotations/annotationInterface1.kt index e33b17a5db4..daf1cb3a106 100644 --- a/j2k/testData/fileOrElement/annotations/annotationInterface1.kt +++ b/j2k/testData/fileOrElement/annotations/annotationInterface1.kt @@ -1,5 +1,7 @@ -internal annotation class Anon(val stringArray: Array, val intArray: IntArray, // string - val string: String) +internal annotation class Anon( + val stringArray: Array, val intArray: IntArray, // string + val string: String +) @Anon(string = "a", stringArray = ["a", "b"], intArray = [1, 2]) @Target(AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FIELD) diff --git a/j2k/testData/fileOrElement/assignmentExpression/bitOperationPriorityComments.kt b/j2k/testData/fileOrElement/assignmentExpression/bitOperationPriorityComments.kt index 81883ed0378..b577634c46c 100644 --- a/j2k/testData/fileOrElement/assignmentExpression/bitOperationPriorityComments.kt +++ b/j2k/testData/fileOrElement/assignmentExpression/bitOperationPriorityComments.kt @@ -1 +1,2 @@ -/*pre*/ 5 /*operand '5'*/ shl /*left shift*/ 16 /*operand '16'*/ or /*or*/ (1 /*operand '1'*/ shr /*right shift*/ 8 /*operand '8'*/) or /*or*/ 0 /*operand '0'*/ /*post comment*/ \ No newline at end of file +/*pre*/ +5 /*operand '5'*/ shl /*left shift*/ 16 /*operand '16'*/ or /*or*/ (1 /*operand '1'*/ shr /*right shift*/ 8 /*operand '8'*/) or /*or*/ 0 /*operand '0'*/ /*post comment*/ \ No newline at end of file diff --git a/j2k/testData/fileOrElement/classExpression/complexExample.kt b/j2k/testData/fileOrElement/classExpression/complexExample.kt index 8e23438a627..b5f8beac434 100644 --- a/j2k/testData/fileOrElement/classExpression/complexExample.kt +++ b/j2k/testData/fileOrElement/classExpression/complexExample.kt @@ -1 +1,2 @@ -val constrArgTypes = arrayOf>(Array::class.java, String::class.java, Int::class.java, Double::class.java) \ No newline at end of file +val constrArgTypes = + arrayOf>(Array::class.java, String::class.java, Int::class.java, Double::class.java) \ No newline at end of file diff --git a/j2k/testData/fileOrElement/comments/commentInsideCall.kt b/j2k/testData/fileOrElement/comments/commentInsideCall.kt index b09ef69eb6c..9e785aabbd3 100644 --- a/j2k/testData/fileOrElement/comments/commentInsideCall.kt +++ b/j2k/testData/fileOrElement/comments/commentInsideCall.kt @@ -6,10 +6,10 @@ object Test { println()// Comment Test - // Comment1 - .foo() - // Comment2 - .indexOf("s") + // Comment1 + .foo() + // Comment2 + .indexOf("s") } fun foo(): String { diff --git a/j2k/testData/fileOrElement/comments/commentsForConstructors.kt b/j2k/testData/fileOrElement/comments/commentsForConstructors.kt index b3687498752..7bbaf8b1d76 100644 --- a/j2k/testData/fileOrElement/comments/commentsForConstructors.kt +++ b/j2k/testData/fileOrElement/comments/commentsForConstructors.kt @@ -12,7 +12,7 @@ internal class A// this is a primary constructor // end of secondary constructor 1 body internal class B// this constructor will disappear -(private val x: Int) // end of constructor body + (private val x: Int) // end of constructor body { fun foo() {} diff --git a/j2k/testData/fileOrElement/comments/fieldsInitializedFromParams.kt b/j2k/testData/fileOrElement/comments/fieldsInitializedFromParams.kt index 798f90772d8..73bd4afea14 100644 --- a/j2k/testData/fileOrElement/comments/fieldsInitializedFromParams.kt +++ b/j2k/testData/fileOrElement/comments/fieldsInitializedFromParams.kt @@ -1,6 +1,8 @@ -internal class C(private val p1: Int /* parameter p1 */ // field p1 - , - /** - * Field myP2 - */ - private val myP2: Int, /* Field p3 */ var p3: Int) \ No newline at end of file +internal class C( + private val p1: Int /* parameter p1 */ // field p1 + , + /** + * Field myP2 + */ + private val myP2: Int, /* Field p3 */ var p3: Int +) diff --git a/j2k/testData/fileOrElement/constructors/customerBuilder.kt b/j2k/testData/fileOrElement/constructors/customerBuilder.kt index 3ef3e091bd5..4d21c59e455 100644 --- a/j2k/testData/fileOrElement/constructors/customerBuilder.kt +++ b/j2k/testData/fileOrElement/constructors/customerBuilder.kt @@ -33,9 +33,9 @@ internal class CustomerBuilder { object User { fun main() { val customer = CustomerBuilder() - .WithFirstName("Homer") - .WithLastName("Simpson") - .Build() + .WithFirstName("Homer") + .WithLastName("Simpson") + .Build() println(customer.firstName) println(customer.lastName) } diff --git a/j2k/testData/fileOrElement/constructors/fieldsInitializedFromParamsAnnotations.kt b/j2k/testData/fileOrElement/constructors/fieldsInitializedFromParamsAnnotations.kt index 29341fe0a63..e62a5593f16 100644 --- a/j2k/testData/fileOrElement/constructors/fieldsInitializedFromParamsAnnotations.kt +++ b/j2k/testData/fileOrElement/constructors/fieldsInitializedFromParamsAnnotations.kt @@ -1 +1,5 @@ -internal class C(@Deprecated("") private val p1: Int, @Deprecated("") private val myP2: Int, @Deprecated("") var p3: Int) +internal class C( + @Deprecated("") private val p1: Int, + @Deprecated("") private val myP2: Int, + @Deprecated("") var p3: Int +) diff --git a/j2k/testData/fileOrElement/constructors/lineBreaksBetweenParameters.kt b/j2k/testData/fileOrElement/constructors/lineBreaksBetweenParameters.kt index 0a6d3da32eb..ea91b4405a5 100644 --- a/j2k/testData/fileOrElement/constructors/lineBreaksBetweenParameters.kt +++ b/j2k/testData/fileOrElement/constructors/lineBreaksBetweenParameters.kt @@ -1,12 +1,18 @@ -internal class C1(arg1: Int, - arg2: Int, - arg3: Int) { +internal class C1( + arg1: Int, + arg2: Int, + arg3: Int +) { - constructor(x: Int, - y: Int) : this(x, x + y, 0) { + constructor( + x: Int, + y: Int + ) : this(x, x + y, 0) { } } -internal class C2(private val arg1: Int, - private val arg2: Int, - arg3: Int) +internal class C2( + private val arg1: Int, + private val arg2: Int, + arg3: Int +) diff --git a/j2k/testData/fileOrElement/detectProperties/Comments.kt b/j2k/testData/fileOrElement/detectProperties/Comments.kt index 692957db0cb..66e85f91ab8 100644 --- a/j2k/testData/fileOrElement/detectProperties/Comments.kt +++ b/j2k/testData/fileOrElement/detectProperties/Comments.kt @@ -1,6 +1,6 @@ internal class A(// comment for field2 getter - // comment for field2 setter - var field2: Int // comment for field2 + // comment for field2 setter + var field2: Int // comment for field2 ) { // Comment for field1 // Comment for field1 getter diff --git a/j2k/testData/fileOrElement/detectProperties/DataClassWithAnnotations.kt b/j2k/testData/fileOrElement/detectProperties/DataClassWithAnnotations.kt index 32a1abee831..115e05e8fef 100644 --- a/j2k/testData/fileOrElement/detectProperties/DataClassWithAnnotations.kt +++ b/j2k/testData/fileOrElement/detectProperties/DataClassWithAnnotations.kt @@ -1,6 +1,8 @@ internal annotation class TestAnnotation -class Test(@param:TestAnnotation @field:TestAnnotation - @get:TestAnnotation - @set:TestAnnotation - var arg: String?) +class Test( + @param:TestAnnotation @field:TestAnnotation + @get:TestAnnotation + @set:TestAnnotation + var arg: String? +) diff --git a/j2k/testData/fileOrElement/docComments/deprecatedDocTagWithMultiLineMessage.kt b/j2k/testData/fileOrElement/docComments/deprecatedDocTagWithMultiLineMessage.kt index 44c6c6832b9..6f4b728cf00 100644 --- a/j2k/testData/fileOrElement/docComments/deprecatedDocTagWithMultiLineMessage.kt +++ b/j2k/testData/fileOrElement/docComments/deprecatedDocTagWithMultiLineMessage.kt @@ -1,7 +1,9 @@ -@Deprecated("Ph'nglui mglw'nafh\n" + - " Cthulhu R'lyeh wgah'nagl fhtagn.\n" + - " 'In His House at R'lyeh\n" + - " Dead Cthulhu waits dreaming,\n" + - " yet He shall rise and His kingdom\n" + - " shall cover the Earth.'") +@Deprecated( + "Ph'nglui mglw'nafh\n" + + " Cthulhu R'lyeh wgah'nagl fhtagn.\n" + + " 'In His House at R'lyeh\n" + + " Dead Cthulhu waits dreaming,\n" + + " yet He shall rise and His kingdom\n" + + " shall cover the Earth.'" +) class TestDeprecatedInJavadocWithMultilineMessage \ No newline at end of file diff --git a/j2k/testData/fileOrElement/enum/runnableImplementation.kt b/j2k/testData/fileOrElement/enum/runnableImplementation.kt index 099aa79fa68..7859644c69a 100644 --- a/j2k/testData/fileOrElement/enum/runnableImplementation.kt +++ b/j2k/testData/fileOrElement/enum/runnableImplementation.kt @@ -2,7 +2,9 @@ internal enum class Color : Runnable { WHITE, BLACK, RED, YELLOW, BLUE; override fun run() { - println("name()=" + name + - ", toString()=" + toString()) + println( + "name()=" + name + + ", toString()=" + toString() + ) } } \ No newline at end of file diff --git a/j2k/testData/fileOrElement/equals/EqOperator.kt b/j2k/testData/fileOrElement/equals/EqOperator.kt index d51fcd408ac..3982621fecc 100644 --- a/j2k/testData/fileOrElement/equals/EqOperator.kt +++ b/j2k/testData/fileOrElement/equals/EqOperator.kt @@ -23,7 +23,25 @@ internal enum class EE { } internal class X { - fun foo(i1: I?, i2: I?, s1: String, s2: String, c1: C, c2: C, i: Int, o1: O, o2: O, e1: E, e2: E, bb1: BB, bb2: BB, arr1: IntArray, arr2: IntArray, ee1: EE?, ee2: EE) { + fun foo( + i1: I?, + i2: I?, + s1: String, + s2: String, + c1: C, + c2: C, + i: Int, + o1: O, + o2: O, + e1: E, + e2: E, + bb1: BB, + bb2: BB, + arr1: IntArray, + arr2: IntArray, + ee1: EE?, + ee2: EE + ) { if (i1 === i2) return if (s1 === s2) return if (c1 == c2) return diff --git a/j2k/testData/fileOrElement/formatting/chainedCall.kt b/j2k/testData/fileOrElement/formatting/chainedCall.kt index 8c13a41b75d..251d69ce13d 100644 --- a/j2k/testData/fileOrElement/formatting/chainedCall.kt +++ b/j2k/testData/fileOrElement/formatting/chainedCall.kt @@ -2,7 +2,7 @@ class C { internal fun foo() { val builder = StringBuilder() builder.append(1) - .append(2).append(3) - .append(4) + .append(2).append(3) + .append(4) } } diff --git a/j2k/testData/fileOrElement/formatting/lineBreaksBetweenArguments.kt b/j2k/testData/fileOrElement/formatting/lineBreaksBetweenArguments.kt index af66aa1a53c..455a602e1e6 100644 --- a/j2k/testData/fileOrElement/formatting/lineBreaksBetweenArguments.kt +++ b/j2k/testData/fileOrElement/formatting/lineBreaksBetweenArguments.kt @@ -2,9 +2,10 @@ internal class F { fun f1(p1: Int, p2: Int, p3: Int, p4: Int, vararg p5: Int) {} fun f2(array: IntArray) { - f1(1, 2, - 3, 4, - *array + f1( + 1, 2, + 3, 4, + *array ) } } diff --git a/j2k/testData/fileOrElement/formatting/parameterList.kt b/j2k/testData/fileOrElement/formatting/parameterList.kt index e09b4aaa005..a1d6856d635 100644 --- a/j2k/testData/fileOrElement/formatting/parameterList.kt +++ b/j2k/testData/fileOrElement/formatting/parameterList.kt @@ -1,6 +1,6 @@ interface Aaa { fun foo( - e1: String, - e2: String + e1: String, + e2: String ) } \ No newline at end of file diff --git a/j2k/testData/fileOrElement/function/lineBreaksBetweenParameters.kt b/j2k/testData/fileOrElement/function/lineBreaksBetweenParameters.kt index 56dd17ab42d..08667776d34 100644 --- a/j2k/testData/fileOrElement/function/lineBreaksBetweenParameters.kt +++ b/j2k/testData/fileOrElement/function/lineBreaksBetweenParameters.kt @@ -2,17 +2,20 @@ internal class C { fun foo1(p1: Int, p2: Int) {} fun foo2( - p1: Int, - p2: Int) { + p1: Int, + p2: Int + ) { } - fun foo3(p1: Int, - p2: Int) { + fun foo3( + p1: Int, + p2: Int + ) { } fun foo4( - p1: Int, p2: Int, - p3: Int, p4: Int + p1: Int, p2: Int, + p3: Int, p4: Int ) { } } \ No newline at end of file diff --git a/j2k/testData/fileOrElement/literalExpression/exponentDouble.kt b/j2k/testData/fileOrElement/literalExpression/exponentDouble.kt index 8b07ce49e8d..1eba81bfc5b 100644 --- a/j2k/testData/fileOrElement/literalExpression/exponentDouble.kt +++ b/j2k/testData/fileOrElement/literalExpression/exponentDouble.kt @@ -1,3 +1,34 @@ class Exponent { - private val doubles = doubleArrayOf(5e5, +5e5, -5e5, 5e+5, 5e-5, 5E5, +5E5, -5E5, 5E+5, 5E-5, 2.5e5, +2.5e5, -2.5e5, 2.5e+5, 2.5e-5, 2.5E5, +2.5E5, -2.5E5, 2.5E+5, 2.5E-5, 5e5, 5e5, 5e5, 5e5, 5e-6, 7e+8, 9e-1, 2e+3, 4e5, 6e7) + private val doubles = doubleArrayOf( + 5e5, + +5e5, + -5e5, + 5e+5, + 5e-5, + 5E5, + +5E5, + -5E5, + 5E+5, + 5E-5, + 2.5e5, + +2.5e5, + -2.5e5, + 2.5e+5, + 2.5e-5, + 2.5E5, + +2.5E5, + -2.5E5, + 2.5E+5, + 2.5E-5, + 5e5, + 5e5, + 5e5, + 5e5, + 5e-6, + 7e+8, + 9e-1, + 2e+3, + 4e5, + 6e7 + ) } \ No newline at end of file diff --git a/j2k/testData/fileOrElement/literalExpression/exponentFloat.kt b/j2k/testData/fileOrElement/literalExpression/exponentFloat.kt index 0c37e43cfe8..2bf24c653aa 100644 --- a/j2k/testData/fileOrElement/literalExpression/exponentFloat.kt +++ b/j2k/testData/fileOrElement/literalExpression/exponentFloat.kt @@ -1,3 +1,32 @@ class Exponent { - private val floats = floatArrayOf(5e5f, +5e5f, -5e5f, 5e+5f, 5e-5f, 5E5f, +5E5f, -5E5f, 5E+5f, 5E-5f, 2.5e5f, +2.5e5f, -2.5e5f, 2.5e+5f, 2.5e-5f, 2.5E5f, +2.5E5f, -2.5E5f, 2.5E+5f, 2.5E-5f, 5e5f, 5e5f, 5e-6f, 7e+8f, 9e-1f, 2e+3f, 4e5f, 6e7f) + private val floats = floatArrayOf( + 5e5f, + +5e5f, + -5e5f, + 5e+5f, + 5e-5f, + 5E5f, + +5E5f, + -5E5f, + 5E+5f, + 5E-5f, + 2.5e5f, + +2.5e5f, + -2.5e5f, + 2.5e+5f, + 2.5e-5f, + 2.5E5f, + +2.5E5f, + -2.5E5f, + 2.5E+5f, + 2.5E-5f, + 5e5f, + 5e5f, + 5e-6f, + 7e+8f, + 9e-1f, + 2e+3f, + 4e5f, + 6e7f + ) } \ No newline at end of file diff --git a/j2k/testData/fileOrElement/methodCallExpression/stringMethods.kt b/j2k/testData/fileOrElement/methodCallExpression/stringMethods.kt index e2d33fcc448..4db126fe28c 100644 --- a/j2k/testData/fileOrElement/methodCallExpression/stringMethods.kt +++ b/j2k/testData/fileOrElement/methodCallExpression/stringMethods.kt @@ -69,19 +69,19 @@ internal class A { val s = "test string" s == "test" s.equals( - "tesT", ignoreCase = true + "tesT", ignoreCase = true ) s.compareTo("Test", ignoreCase = true) s.regionMatches( - 0, - "TE", - 0, - 2, ignoreCase = true + 0, + "TE", + 0, + 2, ignoreCase = true ) s.regionMatches(0, "st", 1, 2) s.matches("\\w+".toRegex()) s.replace("\\w+".toRegex(), "---") - .replaceFirst("([s-t])".toRegex(), "A$1") + .replaceFirst("([s-t])".toRegex(), "A$1") useSplit(s.split("\\s+".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()) useSplit(s.split("\\s+".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()) useSplit(s.split("\\s+".toRegex()).toTypedArray()) @@ -109,9 +109,9 @@ internal class A { Any().toString() String.format( - Locale.FRENCH, - "Je ne mange pas %d jours", - 6 + Locale.FRENCH, + "Je ne mange pas %d jours", + 6 ) String.format("Operation completed with %s", "success") diff --git a/j2k/testData/fileOrElement/mutableCollections/FunctionParameters.kt b/j2k/testData/fileOrElement/mutableCollections/FunctionParameters.kt index 75d142c0c65..d6dc43366d5 100644 --- a/j2k/testData/fileOrElement/mutableCollections/FunctionParameters.kt +++ b/j2k/testData/fileOrElement/mutableCollections/FunctionParameters.kt @@ -2,10 +2,12 @@ import java.util.* internal class A { - fun foo(nonMutableCollection: Collection, - mutableCollection: MutableCollection, - mutableSet: MutableSet, - mutableMap: MutableMap) { + fun foo( + nonMutableCollection: Collection, + mutableCollection: MutableCollection, + mutableSet: MutableSet, + mutableMap: MutableMap + ) { mutableCollection.addAll(nonMutableCollection) mutableSet.add(mutableMap.remove("a")) } diff --git a/j2k/testData/fileOrElement/mutableCollections/Overrides.kt b/j2k/testData/fileOrElement/mutableCollections/Overrides.kt index 39aa620872d..2b86773f8ec 100644 --- a/j2k/testData/fileOrElement/mutableCollections/Overrides.kt +++ b/j2k/testData/fileOrElement/mutableCollections/Overrides.kt @@ -4,7 +4,10 @@ import kotlinApi.KotlinClass abstract class C(field: Int) : KotlinClass(field) { - override fun foo(mutableCollection: MutableCollection, nullableCollection: Collection?): MutableList { + override fun foo( + mutableCollection: MutableCollection, + nullableCollection: Collection? + ): MutableList { return super.foo(mutableCollection, nullableCollection) } } diff --git a/j2k/testData/fileOrElement/newClassExpression/lineBreaks.kt b/j2k/testData/fileOrElement/newClassExpression/lineBreaks.kt index 3790a35a9e0..a2a4abe027b 100644 --- a/j2k/testData/fileOrElement/newClassExpression/lineBreaks.kt +++ b/j2k/testData/fileOrElement/newClassExpression/lineBreaks.kt @@ -2,8 +2,10 @@ internal class C(p1: Int, p2: Int, p3: Int) internal class User { fun foo() { - C(1, - 2, - 3) + C( + 1, + 2, + 3 + ) } } diff --git a/nj2k/testData/copyPaste/ConversionInCorrectContext.expected.kt b/nj2k/testData/copyPaste/ConversionInCorrectContext.expected.kt index d7026fe8098..faa5b84cab2 100644 --- a/nj2k/testData/copyPaste/ConversionInCorrectContext.expected.kt +++ b/nj2k/testData/copyPaste/ConversionInCorrectContext.expected.kt @@ -1,3 +1,4 @@ fun foo(p: Dependency): Double { - return p.getInt().toDouble() // explicit conversion to Double must be added on conversion (if type Dependency) is correctly resolved + return p.getInt() + .toDouble() // explicit conversion to Double must be added on conversion (if type Dependency) is correctly resolved } diff --git a/nj2k/testData/copyPaste/SeveralMethodsSample.expected.kt b/nj2k/testData/copyPaste/SeveralMethodsSample.expected.kt index 590d0c6c02a..59cef4c158b 100644 --- a/nj2k/testData/copyPaste/SeveralMethodsSample.expected.kt +++ b/nj2k/testData/copyPaste/SeveralMethodsSample.expected.kt @@ -5,20 +5,25 @@ class A { var element: PsiElement = element element = JetPsiUtil.ascendIfPropertyAccessor(element) if (element is JetNamedFunction || element is JetProperty) { - val bindingContext: BindingContext = AnalyzerFacadeWithCache.analyzeFileWithCache(element.getContainingJetFile()).getBindingContext() - val declarationDescriptor: DeclarationDescriptor = bindingContext.get(BindingContext.DECLARATION_TO_DESCRIPTOR, element) + val bindingContext: BindingContext = + AnalyzerFacadeWithCache.analyzeFileWithCache(element.getContainingJetFile()).getBindingContext() + val declarationDescriptor: DeclarationDescriptor = + bindingContext.get(BindingContext.DECLARATION_TO_DESCRIPTOR, element) if (declarationDescriptor is CallableMemberDescriptor) { val containingDescriptor: DeclarationDescriptor = declarationDescriptor.getContainingDeclaration() if (containingDescriptor is ClassDescriptor) { return JetBundle.message( - "override.declaration.x.in.y", - DescriptorRenderer.COMPACT.render(declarationDescriptor), - IdeDescriptorRenderers.SOURCE_CODE_SHORT_NAMES_NO_ANNOTATIONS.render(containingDescriptor) + "override.declaration.x.in.y", + DescriptorRenderer.COMPACT.render(declarationDescriptor), + IdeDescriptorRenderers.SOURCE_CODE_SHORT_NAMES_NO_ANNOTATIONS.render(containingDescriptor) ) } } } - assert(element is PsiMethod) { "Method accepts only kotlin functions/properties and java methods, but '" + element.getText().toString() + "' was found" } + assert(element is PsiMethod) { + "Method accepts only kotlin functions/properties and java methods, but '" + element.getText() + .toString() + "' was found" + } return JetRefactoringUtil.formatPsiMethod(element as PsiMethod, true, false) } diff --git a/nj2k/testData/copyPastePlainText/ImportResolve.expected.kt b/nj2k/testData/copyPastePlainText/ImportResolve.expected.kt index 4ee49f60f2c..e5b6f7c606d 100644 --- a/nj2k/testData/copyPastePlainText/ImportResolve.expected.kt +++ b/nj2k/testData/copyPastePlainText/ImportResolve.expected.kt @@ -18,9 +18,11 @@ class Target { fun acceptJavaClass(tbi: ToBeImportedJava?) {} - var ambiguousKotlin: IAmbiguousKotlin = AmbiguousKotlin() // Should not add import in case of 2 declarations in Kotlin + var ambiguousKotlin: IAmbiguousKotlin = + AmbiguousKotlin() // Should not add import in case of 2 declarations in Kotlin - var ambiguous: IAmbiguous = Ambiguous() // Should not add import in case of ambiguous declarations in Kotlin and in Java + var ambiguous: IAmbiguous = + Ambiguous() // Should not add import in case of ambiguous declarations in Kotlin and in Java var ambiguousJava: IAmbiguousJava = AmbiguousJava() // Should not add import in case of 2 declarations in Java diff --git a/nj2k/testData/inference/mutability/collectionMutableCalls.kt b/nj2k/testData/inference/mutability/collectionMutableCalls.kt index 3b381e0a617..0789bd6191a 100644 --- a/nj2k/testData/inference/mutability/collectionMutableCalls.kt +++ b/nj2k/testData/inference/mutability/collectionMutableCalls.kt @@ -1,9 +1,9 @@ fun a( - l0: /*T1@*/MutableCollection, - l1: /*T3@*/MutableCollection, - l2: /*T5@*/MutableCollection, - l3: /*T7@*/MutableCollection, - l4: /*T9@*/MutableCollection + l0: /*T1@*/MutableCollection, + l1: /*T3@*/MutableCollection, + l2: /*T5@*/MutableCollection, + l3: /*T7@*/MutableCollection, + l4: /*T9@*/MutableCollection ) { l0/*T1@MutableCollection*/.add(1/*LIT*/) l1/*T3@MutableCollection*/.addAll(l1/*T3@MutableCollection*/) diff --git a/nj2k/testData/inference/mutability/listIteratorMutableCalls.kt b/nj2k/testData/inference/mutability/listIteratorMutableCalls.kt index 68a0164cd66..c7d24c860f1 100644 --- a/nj2k/testData/inference/mutability/listIteratorMutableCalls.kt +++ b/nj2k/testData/inference/mutability/listIteratorMutableCalls.kt @@ -1,7 +1,7 @@ fun a( - l0: /*T1@*/MutableListIterator, - l1: /*T3@*/MutableListIterator, - l2: /*T5@*/MutableListIterator + l0: /*T1@*/MutableListIterator, + l1: /*T3@*/MutableListIterator, + l2: /*T5@*/MutableListIterator ) { l0/*T1@MutableListIterator*/.add(1/*LIT*/) l1/*T3@MutableListIterator*/.remove() diff --git a/nj2k/testData/inference/mutability/listMutableCalls.kt b/nj2k/testData/inference/mutability/listMutableCalls.kt index 87dfbd15f97..83ad09159eb 100644 --- a/nj2k/testData/inference/mutability/listMutableCalls.kt +++ b/nj2k/testData/inference/mutability/listMutableCalls.kt @@ -1,12 +1,12 @@ fun a( - l0: /*T1@*/MutableList, - l1: /*T3@*/MutableList, - l2: /*T5@*/MutableList, - l3: /*T7@*/MutableList, - l4: /*T9@*/MutableList, - l5: /*T11@*/MutableList, - l6: /*T13@*/MutableList, - l7: /*T15@*/MutableList + l0: /*T1@*/MutableList, + l1: /*T3@*/MutableList, + l2: /*T5@*/MutableList, + l3: /*T7@*/MutableList, + l4: /*T9@*/MutableList, + l5: /*T11@*/MutableList, + l6: /*T13@*/MutableList, + l7: /*T15@*/MutableList ) { l0/*T1@MutableList*/.add(1/*LIT*/) l1/*T3@MutableList*/.addAll(1/*LIT*/, l1/*T3@MutableList*/) diff --git a/nj2k/testData/inference/mutability/mapMutableCalls.kt b/nj2k/testData/inference/mutability/mapMutableCalls.kt index c829bee7480..c4a3352ee87 100644 --- a/nj2k/testData/inference/mutability/mapMutableCalls.kt +++ b/nj2k/testData/inference/mutability/mapMutableCalls.kt @@ -1,8 +1,8 @@ fun a( - l0: /*T2@*/MutableMap, - l1: /*T5@*/MutableMap, - l2: /*T8@*/MutableMap, - l3: /*T11@*/MutableMap + l0: /*T2@*/MutableMap, + l1: /*T5@*/MutableMap, + l2: /*T8@*/MutableMap, + l3: /*T11@*/MutableMap ) { l0/*T2@MutableMap*/.put(1) l1/*T5@MutableMap*/.remove(1/*LIT*/, l1) diff --git a/nj2k/testData/inference/mutability/setMutableCalls.kt b/nj2k/testData/inference/mutability/setMutableCalls.kt index 2973c1d1907..41918013249 100644 --- a/nj2k/testData/inference/mutability/setMutableCalls.kt +++ b/nj2k/testData/inference/mutability/setMutableCalls.kt @@ -1,9 +1,9 @@ fun a( - l0: /*T1@*/MutableSet, - l1: /*T3@*/MutableSet, - l2: /*T5@*/MutableSet, - l3: /*T7@*/MutableSet, - l4: /*T9@*/MutableSet + l0: /*T1@*/MutableSet, + l1: /*T3@*/MutableSet, + l2: /*T5@*/MutableSet, + l3: /*T7@*/MutableSet, + l4: /*T9@*/MutableSet ) { l0/*T1@MutableSet*/.add(1/*LIT*/) l1/*T3@MutableSet*/.addAll(l1/*T3@MutableSet*/) diff --git a/nj2k/testData/newJ2k/annotations/annotationArrayArgument.kt b/nj2k/testData/newJ2k/annotations/annotationArrayArgument.kt index 965209b2b9d..87dea0f0933 100644 --- a/nj2k/testData/newJ2k/annotations/annotationArrayArgument.kt +++ b/nj2k/testData/newJ2k/annotations/annotationArrayArgument.kt @@ -4,7 +4,11 @@ annotation class Ann(vararg val value: Inner, val test1: Array = [In annotation class Inner annotation class InnerParam(val value: KClass<*>) -@Ann(value = [Inner(), Inner()], test1 = [InnerParam(C::class)]) +@Ann( + value = [Inner(), Inner()], test1 = [InnerParam( + C::class + )] +) class C @Ann(Inner(), Inner()) diff --git a/nj2k/testData/newJ2k/annotations/annotationDefault.kt b/nj2k/testData/newJ2k/annotations/annotationDefault.kt index 0d7a0b78b09..4b1661cc99c 100644 --- a/nj2k/testData/newJ2k/annotations/annotationDefault.kt +++ b/nj2k/testData/newJ2k/annotations/annotationDefault.kt @@ -1,5 +1,16 @@ import kotlin.reflect.KClass -annotation class Ann(val i: Int = 1, val i2: IntArray = [1], val i3: IntArray = [1], val klass: KClass<*> = A::class, val klass2: Array> = [A::class], val klass3: Array> = [A::class], val ann: Inner = Inner(), val ann2: Array = [Inner()], val ann3: Array = [Inner(), Inner()]) +annotation class Ann( + val i: Int = 1, + val i2: IntArray = [1], + val i3: IntArray = [1], + val klass: KClass<*> = A::class, + val klass2: Array> = [A::class], + val klass3: Array> = [A::class], + val ann: Inner = Inner(), + val ann2: Array = [Inner()], + val ann3: Array = [Inner(), Inner()] +) + class A annotation class Inner \ No newline at end of file diff --git a/nj2k/testData/newJ2k/annotations/annotationInterface1.kt b/nj2k/testData/newJ2k/annotations/annotationInterface1.kt index 223b81ef08c..c060931fde1 100644 --- a/nj2k/testData/newJ2k/annotations/annotationInterface1.kt +++ b/nj2k/testData/newJ2k/annotations/annotationInterface1.kt @@ -1,5 +1,7 @@ -internal annotation class Anon(val stringArray: Array, val intArray: IntArray, // string - val string: String) +internal annotation class Anon( + val stringArray: Array, val intArray: IntArray, // string + val string: String +) @Anon(string = "a", stringArray = ["a", "b"], intArray = [1, 2]) @Target(AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FIELD) diff --git a/nj2k/testData/newJ2k/annotations/annotationUsages.kt b/nj2k/testData/newJ2k/annotations/annotationUsages.kt index b25865f442f..89f318e588c 100644 --- a/nj2k/testData/newJ2k/annotations/annotationUsages.kt +++ b/nj2k/testData/newJ2k/annotations/annotationUsages.kt @@ -17,7 +17,9 @@ import javaApi.E @Anon4("x", "y") @Anon5(1) @Anon6("x", "y") -@Anon7(String::class, StringBuilder::class) +@Anon7( + String::class, StringBuilder::class +) @Anon8(classes = [String::class, StringBuilder::class]) internal class C { @Anon5(1) diff --git a/nj2k/testData/newJ2k/annotations/kt-31726.kt b/nj2k/testData/newJ2k/annotations/kt-31726.kt index 2f9f707bd89..27a009a7c2e 100644 --- a/nj2k/testData/newJ2k/annotations/kt-31726.kt +++ b/nj2k/testData/newJ2k/annotations/kt-31726.kt @@ -1,7 +1,8 @@ import javaApi.SpecialExternal //Annotation class: -annotation class Special(val names: Array //array is used +annotation class Special( + val names: Array //array is used ) //Class with annotation: @Special(names = ["name1"]) diff --git a/nj2k/testData/newJ2k/assignmentExpression/bitOperationPriorityComments.kt b/nj2k/testData/newJ2k/assignmentExpression/bitOperationPriorityComments.kt index c402b1ef4d8..70bc65fe9d7 100644 --- a/nj2k/testData/newJ2k/assignmentExpression/bitOperationPriorityComments.kt +++ b/nj2k/testData/newJ2k/assignmentExpression/bitOperationPriorityComments.kt @@ -1 +1,2 @@ -/*pre*/5 /*operand '5'*/ shl /*left shift*/16 /*operand '16'*/ or ( /*or*/1 /*operand '1'*/ shr /*right shift*/8 /*operand '8'*/) or /*or*/0 /*operand '0'*/ /*post comment*/ \ No newline at end of file +/*pre*/ +5 /*operand '5'*/ shl /*left shift*/16 /*operand '16'*/ or ( /*or*/1 /*operand '1'*/ shr /*right shift*/8 /*operand '8'*/) or /*or*/0 /*operand '0'*/ /*post comment*/ \ No newline at end of file diff --git a/nj2k/testData/newJ2k/classExpression/complexExample.kt b/nj2k/testData/newJ2k/classExpression/complexExample.kt index 8e23438a627..b5f8beac434 100644 --- a/nj2k/testData/newJ2k/classExpression/complexExample.kt +++ b/nj2k/testData/newJ2k/classExpression/complexExample.kt @@ -1 +1,2 @@ -val constrArgTypes = arrayOf>(Array::class.java, String::class.java, Int::class.java, Double::class.java) \ No newline at end of file +val constrArgTypes = + arrayOf>(Array::class.java, String::class.java, Int::class.java, Double::class.java) \ No newline at end of file diff --git a/nj2k/testData/newJ2k/comments/commentInsideCall.kt b/nj2k/testData/newJ2k/comments/commentInsideCall.kt index aff82619757..f8775cd2639 100644 --- a/nj2k/testData/newJ2k/comments/commentInsideCall.kt +++ b/nj2k/testData/newJ2k/comments/commentInsideCall.kt @@ -5,8 +5,8 @@ object Test { fun main(args: Array) { println() // Comment foo() // Comment1 - // Comment2 - .indexOf("s") + // Comment2 + .indexOf("s") } fun foo(): String { diff --git a/nj2k/testData/newJ2k/comments/commentsForConstructors.kt b/nj2k/testData/newJ2k/comments/commentsForConstructors.kt index af6e758cee3..85e9415ea99 100644 --- a/nj2k/testData/newJ2k/comments/commentsForConstructors.kt +++ b/nj2k/testData/newJ2k/comments/commentsForConstructors.kt @@ -11,7 +11,7 @@ internal class A // this is a primary constructor internal class B // this constructor will disappear // end of constructor body -(private val x: Int) { + (private val x: Int) { fun foo() {} } diff --git a/nj2k/testData/newJ2k/comments/fieldsInitializedFromParams.kt b/nj2k/testData/newJ2k/comments/fieldsInitializedFromParams.kt index 523bf702017..1acabf684cf 100644 --- a/nj2k/testData/newJ2k/comments/fieldsInitializedFromParams.kt +++ b/nj2k/testData/newJ2k/comments/fieldsInitializedFromParams.kt @@ -1,7 +1,8 @@ internal class C(// field p1 - private val p1: Int /* parameter p1 */, - /** - * Field myP2 - */ - private val myP2: Int, /* Field p3 */ - var p3: Int) \ No newline at end of file + private val p1: Int /* parameter p1 */, + /** + * Field myP2 + */ + private val myP2: Int, /* Field p3 */ + var p3: Int +) \ No newline at end of file diff --git a/nj2k/testData/newJ2k/constructors/customerBuilder.kt b/nj2k/testData/newJ2k/constructors/customerBuilder.kt index 04aef872d33..1b6211566a0 100644 --- a/nj2k/testData/newJ2k/constructors/customerBuilder.kt +++ b/nj2k/testData/newJ2k/constructors/customerBuilder.kt @@ -36,9 +36,9 @@ internal class CustomerBuilder { object User { fun main() { val customer = CustomerBuilder() - .WithFirstName("Homer") - .WithLastName("Simpson") - .Build() + .WithFirstName("Homer") + .WithLastName("Simpson") + .Build() println(customer.firstName) println(customer.lastName) } diff --git a/nj2k/testData/newJ2k/constructors/fieldsInitializedFromParams8.kt b/nj2k/testData/newJ2k/constructors/fieldsInitializedFromParams8.kt index babedcbbff8..6ada2973b27 100644 --- a/nj2k/testData/newJ2k/constructors/fieldsInitializedFromParams8.kt +++ b/nj2k/testData/newJ2k/constructors/fieldsInitializedFromParams8.kt @@ -1,2 +1,4 @@ internal open class Base(o: Any?, l: Int) -internal class C(private val string: String) : Base(string, string.length) \ No newline at end of file +internal class C(private val string: String) : Base( + string, string.length +) \ No newline at end of file diff --git a/nj2k/testData/newJ2k/constructors/fieldsInitializedFromParamsAnnotations.kt b/nj2k/testData/newJ2k/constructors/fieldsInitializedFromParamsAnnotations.kt index 765be574382..5050dce1282 100644 --- a/nj2k/testData/newJ2k/constructors/fieldsInitializedFromParamsAnnotations.kt +++ b/nj2k/testData/newJ2k/constructors/fieldsInitializedFromParamsAnnotations.kt @@ -1,4 +1,8 @@ // ERROR: This annotation is not applicable to target 'value parameter' and use site target '@field' // ERROR: This annotation is not applicable to target 'value parameter' and use site target '@param' // ERROR: This annotation is not applicable to target 'value parameter' and use site target '@param' -internal class C(@field:Deprecated("") private val p1: Int, @param:Deprecated("") private val myP2: Int, @param:Deprecated("") var p3: Int) \ No newline at end of file +internal class C( + @field:Deprecated("") private val p1: Int, + @param:Deprecated("") private val myP2: Int, + @param:Deprecated("") var p3: Int +) \ No newline at end of file diff --git a/nj2k/testData/newJ2k/constructors/lineBreaksBetweenParameters.kt b/nj2k/testData/newJ2k/constructors/lineBreaksBetweenParameters.kt index e1fdefe5d0e..ae8f0699cbd 100644 --- a/nj2k/testData/newJ2k/constructors/lineBreaksBetweenParameters.kt +++ b/nj2k/testData/newJ2k/constructors/lineBreaksBetweenParameters.kt @@ -1,11 +1,17 @@ -internal class C1(arg1: Int, - arg2: Int, - arg3: Int) { - constructor(x: Int, - y: Int) : this(x, x + y, 0) { +internal class C1( + arg1: Int, + arg2: Int, + arg3: Int +) { + constructor( + x: Int, + y: Int + ) : this(x, x + y, 0) { } } -internal class C2(private val arg1: Int, - private val arg2: Int, - arg3: Int) \ No newline at end of file +internal class C2( + private val arg1: Int, + private val arg2: Int, + arg3: Int +) \ No newline at end of file diff --git a/nj2k/testData/newJ2k/detectProperties/Comments.kt b/nj2k/testData/newJ2k/detectProperties/Comments.kt index 6d5c56bf805..253601f2b34 100644 --- a/nj2k/testData/newJ2k/detectProperties/Comments.kt +++ b/nj2k/testData/newJ2k/detectProperties/Comments.kt @@ -1,7 +1,8 @@ internal class A( // comment for field2 setter - // comment for field2 getter - var field2 // comment for field2 - : Int) { + // comment for field2 getter + var field2 // comment for field2 + : Int +) { /** * Comment for field1 setter */ diff --git a/nj2k/testData/newJ2k/detectProperties/DataClassWithAnnotations.kt b/nj2k/testData/newJ2k/detectProperties/DataClassWithAnnotations.kt index 5b813d10987..8ec10634899 100644 --- a/nj2k/testData/newJ2k/detectProperties/DataClassWithAnnotations.kt +++ b/nj2k/testData/newJ2k/detectProperties/DataClassWithAnnotations.kt @@ -2,6 +2,8 @@ internal annotation class TestAnnotationField internal annotation class TestAnnotationParam internal annotation class TestAnnotationGet internal annotation class TestAnnotationSet -class Test(@field:TestAnnotationField @set:TestAnnotationSet - @get:TestAnnotationGet - @param:TestAnnotationParam var arg: String) \ No newline at end of file +class Test( + @field:TestAnnotationField @set:TestAnnotationSet + @get:TestAnnotationGet + @param:TestAnnotationParam var arg: String +) \ No newline at end of file diff --git a/nj2k/testData/newJ2k/detectProperties/commentInInitStatement.kt b/nj2k/testData/newJ2k/detectProperties/commentInInitStatement.kt index eeb726c94ed..2c060612185 100644 --- a/nj2k/testData/newJ2k/detectProperties/commentInInitStatement.kt +++ b/nj2k/testData/newJ2k/detectProperties/commentInInitStatement.kt @@ -1,3 +1,3 @@ class Nya /*comment before*/ /* comment after*/ // and after again -( /*1*/ /*3*/ /*4*/private val i: Int) \ No newline at end of file + ( /*1*/ /*3*/ /*4*/private val i: Int) \ No newline at end of file diff --git a/nj2k/testData/newJ2k/docComments/deprecatedDocTagWithMultiLineMessage.kt b/nj2k/testData/newJ2k/docComments/deprecatedDocTagWithMultiLineMessage.kt index f0c221b93bf..65d6518c04f 100644 --- a/nj2k/testData/newJ2k/docComments/deprecatedDocTagWithMultiLineMessage.kt +++ b/nj2k/testData/newJ2k/docComments/deprecatedDocTagWithMultiLineMessage.kt @@ -1,7 +1,9 @@ -@Deprecated("""Ph'nglui mglw'nafh +@Deprecated( + """Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn. 'In His House at R'lyeh Dead Cthulhu waits dreaming, yet He shall rise and His kingdom - shall cover the Earth.'""") + shall cover the Earth.'""" +) class TestDeprecatedInJavadocWithMultilineMessage \ No newline at end of file diff --git a/nj2k/testData/newJ2k/enum/runnableImplementation.kt b/nj2k/testData/newJ2k/enum/runnableImplementation.kt index 099aa79fa68..7859644c69a 100644 --- a/nj2k/testData/newJ2k/enum/runnableImplementation.kt +++ b/nj2k/testData/newJ2k/enum/runnableImplementation.kt @@ -2,7 +2,9 @@ internal enum class Color : Runnable { WHITE, BLACK, RED, YELLOW, BLUE; override fun run() { - println("name()=" + name + - ", toString()=" + toString()) + println( + "name()=" + name + + ", toString()=" + toString() + ) } } \ No newline at end of file diff --git a/nj2k/testData/newJ2k/equals/EqOperator.kt b/nj2k/testData/newJ2k/equals/EqOperator.kt index a44b495cd52..fd27faa2880 100644 --- a/nj2k/testData/newJ2k/equals/EqOperator.kt +++ b/nj2k/testData/newJ2k/equals/EqOperator.kt @@ -19,7 +19,25 @@ internal enum class EE { } internal class X { - fun foo(i1: I?, i2: I?, s1: String, s2: String, c1: C, c2: C, i: Int, o1: O, o2: O, e1: E, e2: E, bb1: BB, bb2: BB, arr1: IntArray, arr2: IntArray, ee1: EE?, ee2: EE) { + fun foo( + i1: I?, + i2: I?, + s1: String, + s2: String, + c1: C, + c2: C, + i: Int, + o1: O, + o2: O, + e1: E, + e2: E, + bb1: BB, + bb2: BB, + arr1: IntArray, + arr2: IntArray, + ee1: EE?, + ee2: EE + ) { if (i1 === i2) return if (s1 === s2) return if (c1 == c2) return diff --git a/nj2k/testData/newJ2k/formatting/chainedCall.kt b/nj2k/testData/newJ2k/formatting/chainedCall.kt index c120cca456f..a50b3ecf245 100644 --- a/nj2k/testData/newJ2k/formatting/chainedCall.kt +++ b/nj2k/testData/newJ2k/formatting/chainedCall.kt @@ -2,7 +2,7 @@ class C { fun foo() { val builder = StringBuilder() builder.append(1) - .append(2).append(3) - .append(4) + .append(2).append(3) + .append(4) } } \ No newline at end of file diff --git a/nj2k/testData/newJ2k/formatting/lineBreaksBetweenArguments.kt b/nj2k/testData/newJ2k/formatting/lineBreaksBetweenArguments.kt index c98620e93de..33ec21dd9a5 100644 --- a/nj2k/testData/newJ2k/formatting/lineBreaksBetweenArguments.kt +++ b/nj2k/testData/newJ2k/formatting/lineBreaksBetweenArguments.kt @@ -1,9 +1,10 @@ internal class F { fun f1(p1: Int, p2: Int, p3: Int, p4: Int, vararg p5: Int) {} fun f2(array: IntArray) { - f1(1, 2, - 3, 4, - *array + f1( + 1, 2, + 3, 4, + *array ) } } \ No newline at end of file diff --git a/nj2k/testData/newJ2k/formatting/parameterList.kt b/nj2k/testData/newJ2k/formatting/parameterList.kt index 485b655424b..5064843c770 100644 --- a/nj2k/testData/newJ2k/formatting/parameterList.kt +++ b/nj2k/testData/newJ2k/formatting/parameterList.kt @@ -1,6 +1,6 @@ interface Aaa { fun foo( - e1: String?, - e2: String? + e1: String?, + e2: String? ) } \ No newline at end of file diff --git a/nj2k/testData/newJ2k/function/lineBreaksBetweenParameters.kt b/nj2k/testData/newJ2k/function/lineBreaksBetweenParameters.kt index f01965d887b..f7cc52b50c3 100644 --- a/nj2k/testData/newJ2k/function/lineBreaksBetweenParameters.kt +++ b/nj2k/testData/newJ2k/function/lineBreaksBetweenParameters.kt @@ -1,17 +1,20 @@ internal class C { fun foo1(p1: Int, p2: Int) {} fun foo2( - p1: Int, - p2: Int) { + p1: Int, + p2: Int + ) { } - fun foo3(p1: Int, - p2: Int) { + fun foo3( + p1: Int, + p2: Int + ) { } fun foo4( - p1: Int, p2: Int, - p3: Int, p4: Int + p1: Int, p2: Int, + p3: Int, p4: Int ) { } } \ No newline at end of file diff --git a/nj2k/testData/newJ2k/issues/kt-19569.kt b/nj2k/testData/newJ2k/issues/kt-19569.kt index 30f5985f0dc..2eaf74baa79 100644 --- a/nj2k/testData/newJ2k/issues/kt-19569.kt +++ b/nj2k/testData/newJ2k/issues/kt-19569.kt @@ -1,6 +1,8 @@ class TestJavaBoxedPrimitives { - fun foo(x1: Boolean, x2: Byte, x3: Short, x4: Int, - x5: Long, x6: Float, x7: Double, x8: Char): Array { + fun foo( + x1: Boolean, x2: Byte, x3: Short, x4: Int, + x5: Long, x6: Float, x7: Double, x8: Char + ): Array { return arrayOf(x1, x2, x3, x4, x5, x6, x7, x8) } } diff --git a/nj2k/testData/newJ2k/issues/kt-21189.kt b/nj2k/testData/newJ2k/issues/kt-21189.kt index b25b10738b3..3028c8d68e5 100644 --- a/nj2k/testData/newJ2k/issues/kt-21189.kt +++ b/nj2k/testData/newJ2k/issues/kt-21189.kt @@ -1,5 +1,17 @@ object ArrayInitializerBugKt { - private val GREETING = byteArrayOf('H'.toByte(), 'e'.toByte(), 'l'.toByte(), 'l'.toByte(), 'o'.toByte(), ','.toByte(), ' '.toByte(), 'b'.toByte(), 'u'.toByte(), 'g'.toByte(), '!'.toByte()) + private val GREETING = byteArrayOf( + 'H'.toByte(), + 'e'.toByte(), + 'l'.toByte(), + 'l'.toByte(), + 'o'.toByte(), + ','.toByte(), + ' '.toByte(), + 'b'.toByte(), + 'u'.toByte(), + 'g'.toByte(), + '!'.toByte() + ) @JvmStatic fun main(args: Array) { diff --git a/nj2k/testData/newJ2k/javaStreamsApi/createStream.kt b/nj2k/testData/newJ2k/javaStreamsApi/createStream.kt index cddd599337a..9f2549c25d3 100644 --- a/nj2k/testData/newJ2k/javaStreamsApi/createStream.kt +++ b/nj2k/testData/newJ2k/javaStreamsApi/createStream.kt @@ -5,23 +5,23 @@ import java.util.stream.Stream internal class Test { fun main(lst: List) { val streamOfList = lst.stream() - .map { x: String -> x + "e" } - .collect(Collectors.toList()) + .map { x: String -> x + "e" } + .collect(Collectors.toList()) val streamOfElements = Stream.of(1, 2, 3) - .map { x: Int -> x + 1 } - .collect(Collectors.toList()) + .map { x: Int -> x + 1 } + .collect(Collectors.toList()) val array = arrayOf(1, 2, 3) val streamOfArray = Arrays.stream(array) - .map { x: Int -> x + 1 } - .collect(Collectors.toList()) + .map { x: Int -> x + 1 } + .collect(Collectors.toList()) val streamOfArray2 = Stream.of(*array) - .map { x: Int -> x + 1 } - .collect(Collectors.toList()) + .map { x: Int -> x + 1 } + .collect(Collectors.toList()) val streamIterate = Stream.iterate(2, { v: Int -> v * 2 }) - .map { x: Int -> x + 1 } - .collect(Collectors.toList()) + .map { x: Int -> x + 1 } + .collect(Collectors.toList()) val streamGenerate = Stream.generate { 42 } - .map { x: Int -> x + 1 } - .collect(Collectors.toList()) + .map { x: Int -> x + 1 } + .collect(Collectors.toList()) } } \ No newline at end of file diff --git a/nj2k/testData/newJ2k/javaStreamsApi/formatting.kt b/nj2k/testData/newJ2k/javaStreamsApi/formatting.kt index eaa6c4afae5..f99d514ad73 100644 --- a/nj2k/testData/newJ2k/javaStreamsApi/formatting.kt +++ b/nj2k/testData/newJ2k/javaStreamsApi/formatting.kt @@ -4,11 +4,12 @@ import java.util.stream.Collectors internal class Test { fun main(lst: List) { val newLst = /*before list*/lst /*after list*/.stream /*before stream*/() /* after stream*/ - .filter { x: Int -> x > 10 } - .map { x: Int -> x + 2 } /*some comment*/.distinct /*another comment*/() /* one more comment */.sorted() /*another one comment*/ - .sorted(Comparator.naturalOrder()) - .peek { x: Int? -> println(x) }.limit(1) - .skip(42) /*skipped*/ /*collecting one*/ - .collect /*collecting two */(Collectors.toList()) /* cool */ + .filter { x: Int -> x > 10 } + .map { x: Int -> x + 2 } /*some comment*/.distinct /*another comment*/() /* one more comment */ + .sorted() /*another one comment*/ + .sorted(Comparator.naturalOrder()) + .peek { x: Int? -> println(x) }.limit(1) + .skip(42) /*skipped*/ /*collecting one*/ + .collect /*collecting two */(Collectors.toList()) /* cool */ } } \ No newline at end of file diff --git a/nj2k/testData/newJ2k/javaStreamsApi/kt-21467.kt b/nj2k/testData/newJ2k/javaStreamsApi/kt-21467.kt index 4b8626e0ff2..ca7af52fe9a 100644 --- a/nj2k/testData/newJ2k/javaStreamsApi/kt-21467.kt +++ b/nj2k/testData/newJ2k/javaStreamsApi/kt-21467.kt @@ -4,18 +4,18 @@ import java.util.stream.Stream internal class Test { fun main() { val activities = Stream.of("12") - .map { v: String -> v + "nya" } - .filter { v: String? -> v != null } - .flatMap { v: String -> - Stream.of(v) - .flatMap { s: String -> Stream.of(s) } - }.filter { v: String -> - val name = v.javaClass.name - if (name == "name") { - return@filter false - } - name != "other_name" + .map { v: String -> v + "nya" } + .filter { v: String? -> v != null } + .flatMap { v: String -> + Stream.of(v) + .flatMap { s: String -> Stream.of(s) } + }.filter { v: String -> + val name = v.javaClass.name + if (name == "name") { + return@filter false } - .collect(Collectors.toList()) + name != "other_name" + } + .collect(Collectors.toList()) } } \ No newline at end of file diff --git a/nj2k/testData/newJ2k/javaStreamsApi/streamOperations.kt b/nj2k/testData/newJ2k/javaStreamsApi/streamOperations.kt index 24f235a60c7..59ed0e237c5 100644 --- a/nj2k/testData/newJ2k/javaStreamsApi/streamOperations.kt +++ b/nj2k/testData/newJ2k/javaStreamsApi/streamOperations.kt @@ -4,14 +4,14 @@ import java.util.stream.Collectors internal class Test { fun main(lst: List) { val newLst = lst.stream() - .filter { x: Int -> x > 10 } - .map { x: Int -> x + 2 } - .distinct() - .sorted() - .sorted(Comparator.naturalOrder()) - .peek { x: Int? -> println(x) } - .limit(1) - .skip(42) - .collect(Collectors.toList()) + .filter { x: Int -> x > 10 } + .map { x: Int -> x + 2 } + .distinct() + .sorted() + .sorted(Comparator.naturalOrder()) + .peek { x: Int? -> println(x) } + .limit(1) + .skip(42) + .collect(Collectors.toList()) } } \ No newline at end of file diff --git a/nj2k/testData/newJ2k/literalExpression/exponentDouble.kt b/nj2k/testData/newJ2k/literalExpression/exponentDouble.kt index 341d2b10023..8ce3a5ef7db 100644 --- a/nj2k/testData/newJ2k/literalExpression/exponentDouble.kt +++ b/nj2k/testData/newJ2k/literalExpression/exponentDouble.kt @@ -1,9 +1,9 @@ class Exponent { private val doubles = doubleArrayOf( - 5e5, +5e5, -5e5, 5e+5, 5e-5, - 5E5, +5E5, -5E5, 5E+5, 5E-5, - 2.5e5, +2.5e5, -2.5e5, 2.5e+5, 2.5e-5, - 2.5E5, +2.5E5, -2.5E5, 2.5E+5, 2.5E-5, 5e5, 5e5, 5e5, 5e5, - 5e-6, 7e+8, 9e-1, 2e+3, 4e5, 6e7 + 5e5, +5e5, -5e5, 5e+5, 5e-5, + 5E5, +5E5, -5E5, 5E+5, 5E-5, + 2.5e5, +2.5e5, -2.5e5, 2.5e+5, 2.5e-5, + 2.5E5, +2.5E5, -2.5E5, 2.5E+5, 2.5E-5, 5e5, 5e5, 5e5, 5e5, + 5e-6, 7e+8, 9e-1, 2e+3, 4e5, 6e7 ) } \ No newline at end of file diff --git a/nj2k/testData/newJ2k/literalExpression/exponentFloat.kt b/nj2k/testData/newJ2k/literalExpression/exponentFloat.kt index 9e5e9ecf6d4..5141c1b0dd1 100644 --- a/nj2k/testData/newJ2k/literalExpression/exponentFloat.kt +++ b/nj2k/testData/newJ2k/literalExpression/exponentFloat.kt @@ -1,10 +1,10 @@ class Exponent { private val floats = floatArrayOf( - 5e5f, +5e5f, -5e5f, 5e+5f, 5e-5f, - 5E5f, +5E5f, -5E5f, 5E+5f, 5E-5f, - 2.5e5f, +2.5e5f, -2.5e5f, 2.5e+5f, 2.5e-5f, - 2.5E5f, +2.5E5f, -2.5E5f, 2.5E+5f, 2.5E-5f, - 5e5f, 5e5f, - 5e-6f, 7e+8f, 9e-1f, 2e+3f, 4e5f, 6e7f + 5e5f, +5e5f, -5e5f, 5e+5f, 5e-5f, + 5E5f, +5E5f, -5E5f, 5E+5f, 5E-5f, + 2.5e5f, +2.5e5f, -2.5e5f, 2.5e+5f, 2.5e-5f, + 2.5E5f, +2.5E5f, -2.5E5f, 2.5E+5f, 2.5E-5f, + 5e5f, 5e5f, + 5e-6f, 7e+8f, 9e-1f, 2e+3f, 4e5f, 6e7f ) } \ No newline at end of file diff --git a/nj2k/testData/newJ2k/methodCallExpression/stringMethods.kt b/nj2k/testData/newJ2k/methodCallExpression/stringMethods.kt index 0f582d09d38..b45ca3083ea 100644 --- a/nj2k/testData/newJ2k/methodCallExpression/stringMethods.kt +++ b/nj2k/testData/newJ2k/methodCallExpression/stringMethods.kt @@ -66,16 +66,18 @@ internal class A { val s = "test string" s == "test" s.equals( - "tesT", ignoreCase = true) + "tesT", ignoreCase = true + ) s.compareTo("Test", ignoreCase = true) s.regionMatches( - 0, - "TE", - 0, - 2, ignoreCase = true) + 0, + "TE", + 0, + 2, ignoreCase = true + ) s.regionMatches(0, "st", 1, 2) s.replace("\\w+".toRegex(), "---") - .replaceFirst("([s-t])".toRegex(), "A$1") + .replaceFirst("([s-t])".toRegex(), "A$1") /* TODO s.matches("\\w+"); useSplit(s.split("\\s+")); @@ -102,9 +104,9 @@ internal class A { 3.14.toString() Any().toString() String.format( - Locale.FRENCH, - "Je ne mange pas %d jours", - 6 + Locale.FRENCH, + "Je ne mange pas %d jours", + 6 ) String.format("Operation completed with %s", "success") val chars = charArrayOf('a', 'b', 'c') diff --git a/nj2k/testData/newJ2k/mutableCollections/FunctionParameters.kt b/nj2k/testData/newJ2k/mutableCollections/FunctionParameters.kt index 2dcc227b239..54672773f5f 100644 --- a/nj2k/testData/newJ2k/mutableCollections/FunctionParameters.kt +++ b/nj2k/testData/newJ2k/mutableCollections/FunctionParameters.kt @@ -1,8 +1,10 @@ internal class A { - fun foo(nonMutableCollection: Collection?, - mutableCollection: MutableCollection, - mutableSet: MutableSet, - mutableMap: MutableMap) { + fun foo( + nonMutableCollection: Collection?, + mutableCollection: MutableCollection, + mutableSet: MutableSet, + mutableMap: MutableMap + ) { mutableCollection.addAll(nonMutableCollection!!) mutableSet.add(mutableMap.remove("a")) } diff --git a/nj2k/testData/newJ2k/mutableCollections/Overrides.kt b/nj2k/testData/newJ2k/mutableCollections/Overrides.kt index e1e084a5012..9cb477b1e04 100644 --- a/nj2k/testData/newJ2k/mutableCollections/Overrides.kt +++ b/nj2k/testData/newJ2k/mutableCollections/Overrides.kt @@ -3,7 +3,10 @@ package javaApi import kotlinApi.KotlinClass abstract class C(field: Int) : KotlinClass(field) { - override fun foo(mutableCollection: MutableCollection, nullableCollection: Collection?): MutableList { + override fun foo( + mutableCollection: MutableCollection, + nullableCollection: Collection? + ): MutableList { return super.foo(mutableCollection, nullableCollection) } } \ No newline at end of file diff --git a/nj2k/testData/newJ2k/newClassExpression/lineBreaks.kt b/nj2k/testData/newJ2k/newClassExpression/lineBreaks.kt index 0191ba7d5b5..24173536452 100644 --- a/nj2k/testData/newJ2k/newClassExpression/lineBreaks.kt +++ b/nj2k/testData/newJ2k/newClassExpression/lineBreaks.kt @@ -1,8 +1,10 @@ internal class C(p1: Int, p2: Int, p3: Int) internal class User { fun foo() { - C(1, - 2, - 3) + C( + 1, + 2, + 3 + ) } } \ No newline at end of file diff --git a/nj2k/testData/newJ2k/overloads/ConflictParameterName.kt b/nj2k/testData/newJ2k/overloads/ConflictParameterName.kt index 28c23487886..20bc2cef2d2 100644 --- a/nj2k/testData/newJ2k/overloads/ConflictParameterName.kt +++ b/nj2k/testData/newJ2k/overloads/ConflictParameterName.kt @@ -22,7 +22,15 @@ class Test { private get() = 1 @JvmOverloads - fun foo(a: Boolean = this.a, b: Boolean = this.b, c: Boolean = c(), isD: Boolean = this.isD, e: Boolean = this.e.ee, f: Boolean = F().f, g: Int = this.g) { + fun foo( + a: Boolean = this.a, + b: Boolean = this.b, + c: Boolean = c(), + isD: Boolean = this.isD, + e: Boolean = this.e.ee, + f: Boolean = F().f, + g: Int = this.g + ) { } @JvmOverloads diff --git a/nj2k/testData/newJ2k/types/capturedTypeInStreamsLambda.kt b/nj2k/testData/newJ2k/types/capturedTypeInStreamsLambda.kt index bdf49050b7f..801a4e293e0 100644 --- a/nj2k/testData/newJ2k/types/capturedTypeInStreamsLambda.kt +++ b/nj2k/testData/newJ2k/types/capturedTypeInStreamsLambda.kt @@ -3,7 +3,7 @@ import java.util.stream.Collectors class Test { private fun addPackages(packages: Collection) { val sorted = packages.stream() - .filter { repoPackage: Number? -> repoPackage != null } - .collect(Collectors.toList()) + .filter { repoPackage: Number? -> repoPackage != null } + .collect(Collectors.toList()) } }