diff --git a/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/KotlinCommonBlock.kt b/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/KotlinCommonBlock.kt index 4e749ec08b9..73839daded1 100644 --- a/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/KotlinCommonBlock.kt +++ b/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/KotlinCommonBlock.kt @@ -6,6 +6,7 @@ package org.jetbrains.kotlin.idea.formatter import com.intellij.formatting.* +import com.intellij.formatting.blocks.prev import com.intellij.lang.ASTNode import com.intellij.openapi.util.TextRange import com.intellij.psi.PsiComment @@ -1038,7 +1039,7 @@ private val INDENT_RULES = arrayOf( strategy("Closing parenthesis for conditions") .forType(RPAR) - .forElement { node -> !hasErrorElementBefore(node) } + .forElement { node -> !hasErrorElementBefore(node) || node.prev()?.textLength == 0 } .within(IF, WHEN_ENTRY, WHILE, DO_WHILE, FOR, WHEN) .set(Indent.getNoneIndent()), diff --git a/idea/line-indent-provider/src/org/jetbrains/kotlin/idea/formatter/lineIndent/KotlinLikeLangLineIndentProvider.kt b/idea/line-indent-provider/src/org/jetbrains/kotlin/idea/formatter/lineIndent/KotlinLikeLangLineIndentProvider.kt index 85d4e324e02..d35a0491fef 100644 --- a/idea/line-indent-provider/src/org/jetbrains/kotlin/idea/formatter/lineIndent/KotlinLikeLangLineIndentProvider.kt +++ b/idea/line-indent-provider/src/org/jetbrains/kotlin/idea/formatter/lineIndent/KotlinLikeLangLineIndentProvider.kt @@ -15,6 +15,7 @@ import com.intellij.psi.impl.source.codeStyle.lineIndent.IndentCalculator import com.intellij.psi.impl.source.codeStyle.lineIndent.JavaLikeLangLineIndentProvider import com.intellij.psi.impl.source.codeStyle.lineIndent.JavaLikeLangLineIndentProvider.JavaLikeElement.* import com.intellij.psi.tree.IElementType +import com.intellij.util.text.CharArrayUtil import org.jetbrains.kotlin.idea.KotlinLanguage import org.jetbrains.kotlin.idea.formatter.lineIndent.KotlinLikeLangLineIndentProvider.KotlinElement.* import org.jetbrains.kotlin.lexer.KtTokens @@ -56,6 +57,7 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider override fun getIndent(project: Project, editor: Editor, language: Language?, offset: Int): IndentCalculator? { val factory = IndentCalculatorFactory(project, editor) + val settings = indentionSettings(project) val currentPosition = getPosition(editor, offset) if (!currentPosition.matchesRule { it.isAt(Whitespace) && it.isAtMultiline }) return null @@ -85,6 +87,11 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider after.moveBeforeParentheses(TemplateEntryOpen, TemplateEntryClose) return factory.createIndentCalculator(indent, after.startOffset) } + + before.isAt(LeftParenthesis) && after.isAt(RightParenthesis) -> { + val indentCalculator = factory.createIndentCalculatorForParenthesis(before, currentPosition, after, offset, settings) + if (indentCalculator != null) return indentCalculator + } } return before.controlFlowStatementBefore()?.let { controlFlowKeywordPosition -> @@ -99,6 +106,182 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider } } + private fun IndentCalculatorFactory.createIndentCalculatorForParenthesis( + leftParenthesis: SemanticEditorPosition, + currentPosition: SemanticEditorPosition, + rightParenthesis: SemanticEditorPosition, + offset: Int, + settings: KotlinIndentationAdjuster, + ): IndentCalculator? { + assert(leftParenthesis.isAt(LeftParenthesis)) + assert(rightParenthesis.isAt(RightParenthesis)) + + // case only for caret before [RightParenthesis] + if (!currentPosition.hasLineBreaksAfter(offset)) { + val indentForParentheses by lazy { + if (settings.alignWhenMultilineFunctionParentheses) createAlignMultilineIndent(leftParenthesis) else Indent.getNoneIndent() + } + + val functionKeyword = findFunctionDeclarationBefore(leftParenthesis) + if (functionKeyword != null) { + return createIndentCalculator(indentForParentheses, functionKeyword.startOffset) + } + + // NB: this covered [KtTokens.CONSTRUCTOR_KEYWORD], [KtTokens.SET_KEYWORD], [KtTokens.GET_KEYWORD], [KtTokens.INIT_KEYWORD] as well + if (isSimilarToFunctionInvocation(leftParenthesis)) { + return createIndentCalculator(indentForParentheses, leftParenthesis.startOffset) + } + + if (isDestructuringDeclaration(leftParenthesis, rightParenthesis)) { + return createIndentCalculator(Indent.getNoneIndent(), leftParenthesis.startOffset) + } + + leftParenthesis.copyAnd { it.moveBeforeIgnoringWhiteSpaceOrComment() }.let { keyword -> + if (keyword.isControlFlowKeyword()) { + return createIndentCalculator(Indent.getNoneIndent(), keyword.startOffset) + } + } + + val indentForBinaryExpression = if (settings.alignWhenMultilineBinaryExpression) + createAlignMultilineIndent(leftParenthesis) + else + Indent.getContinuationIndent() + + return createIndentCalculator(indentForBinaryExpression, leftParenthesis.startOffset) + } + + return null + } + + /** + * @return position of `fun` keyword before the declaration or null + * TODO: support [KtTokens.CONSTRUCTOR_KEYWORD], [KtTokens.INIT_KEYWORD]. Maybe [KtTokens.SET_KEYWORD], [KtTokens.GET_KEYWORD] (related to KT-39444) + */ + private fun findFunctionDeclarationBefore(leftParenthesis: SemanticEditorPosition): SemanticEditorPosition? = + with(leftParenthesis.copy()) { + assert(leftParenthesis.isAt(LeftParenthesis)) + + moveBeforeIgnoringWhiteSpaceOrComment() + + // anonymous function `val a = fun() { }` + if (isAt(FunctionKeyword)) return this + moveBeforeWhileThisIsWhiteSpaceOrComment() + + // anonymous function with receiver `val a = fun String.Companion????.() { }` + if (isAt(Dot)) { + moveBeforeIgnoringWhiteSpaceOrComment() + if (!moveBeforeTypeQualifierIfPossible()) return null + return if (isAt(FunctionKeyword)) this else null + } + + // name of declaration + if (!isAt(Identifier)) return null + if (!moveBeforeTypeQualifierIfPossible()) return null + + moveBeforeTypeParametersIfPossible() + + takeIf { it.isAt(FunctionKeyword) } + } + + private fun isSimilarToFunctionInvocation(leftParenthesis: SemanticEditorPosition): Boolean = with(leftParenthesis.copy()) { + assert(isAt(LeftParenthesis)) + + moveBeforeIgnoringWhiteSpaceOrComment() + // calls with types e.g. `test()` + moveBeforeTypeParametersIfPossible() + + return isAt(Identifier) || isAt(KtTokens.THIS_KEYWORD) + } + + private fun isDestructuringDeclaration( + leftParenthesis: SemanticEditorPosition, + rightParenthesis: SemanticEditorPosition + ): Boolean = with(leftParenthesis.copy()) { + moveBeforeIgnoringWhiteSpaceOrComment() + + // val (a, b) = 1 to 2 + if (isAt(KtTokens.VAR_KEYWORD) || isAt(KtTokens.VAL_KEYWORD)) { + return true + } + + // in lambda like `val a = { i: Int -> println(i) }` + if (!rightParenthesis.moveBeforeParametersIfPossible()) return false + + return isAt(BlockOpeningBrace) + } + + /** + * @receiver start position of any parameter + */ + private fun SemanticEditorPosition.moveBeforeParametersIfPossible(): Boolean { + while (!isAtEnd) { + if (!moveBeforeParameterIfPossible()) return false + if (!isAt(Comma)) return true + moveBeforeIgnoringWhiteSpaceOrComment() + } + + return false + } + + /** + * @receiver start position of any parameter + */ + private fun SemanticEditorPosition.moveBeforeParameterIfPossible(): Boolean { + // destructuring declaration in lambda parameters without type + // { a, (b, c), d -> + // ^ + if (isAt(RightParenthesis)) return moveBeforeParenthesesIfPossible() + + if (!moveBeforeTypeQualifierIfPossible()) return false + + // optional colon + // { a: Int -> + // ^ + // (a: Int) + // ^ + if (isAt(Colon)) { + moveBeforeIgnoringWhiteSpaceOrComment() + + // destructuring declaration in lambda parameters with type + // { a, b, (c, d): Pair, e -> + // ^ + if (isAt(RightParenthesis)) return moveBeforeParenthesesIfPossible() + + // { a: Int -> + // ^ + // (a: Int) + // ^ + if (!isAt(Identifier)) return false + moveBeforeIgnoringWhiteSpaceOrComment() + } + + return true + } + + /*** + * Constructions like `OuterClass/* */.MiddleClass?????`, `String.Companion.testName` + * + * @receiver position of identifier + */ + private fun SemanticEditorPosition.moveBeforeTypeQualifierIfPossible(): Boolean { + while (!isAtEnd) { + moveBeforeOptionalMix(Quest, *WHITE_SPACE_OR_COMMENT_BIT_SET) + moveBeforeTypeParametersIfPossible() + if (!isAt(Identifier)) return false + moveBeforeIgnoringWhiteSpaceOrComment() + if (!isAt(Dot)) return true + moveBeforeIgnoringWhiteSpaceOrComment() + } + + return false + } + + private fun createAlignMultilineIndent(position: SemanticEditorPosition): Indent { + val beforeLineStart = CharArrayUtil.shiftBackwardUntil(position.chars, position.startOffset, "\n") + 1 + val beforeLineWithoutIndentStart = CharArrayUtil.shiftForward(position.chars, beforeLineStart, " \t") + return Indent.getSpaceIndent(position.startOffset - beforeLineWithoutIndentStart) + } + private fun SemanticEditorPosition.isWhileInsideDoWhile(): Boolean { if (!isAt(WhileKeyword)) return false with(copy()) { @@ -139,7 +322,7 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider private fun SemanticEditorPosition.isCatchKeyword(): Boolean = with(copy()) { // try-catch-*-catch do { - if (!isAt(KtTokens.IDENTIFIER)) return false + if (!isAt(Identifier)) return false if (!similarToCatchKeyword()) return false moveBeforeIgnoringWhiteSpaceOrComment() @@ -154,7 +337,7 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider } private fun SemanticEditorPosition.isFinallyKeyword(): Boolean { - if (!isAt(KtTokens.IDENTIFIER)) return false + if (!isAt(Identifier)) return false if (textOfCurrentPosition() != KtTokens.FINALLY_KEYWORD.value) return false with(copy()) { moveBeforeIgnoringWhiteSpaceOrComment() @@ -172,12 +355,17 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider private fun SemanticEditorPosition.moveBeforeBlockIfPossible(): Boolean = moveBeforeParenthesesIfPossible( leftParenthesis = BlockOpeningBrace, - rightParenthesis = BlockClosingBrace + rightParenthesis = BlockClosingBrace, + ) + + private fun SemanticEditorPosition.moveBeforeTypeParametersIfPossible(): Boolean = moveBeforeParenthesesIfPossible( + leftParenthesis = OpenTypeBrace, + rightParenthesis = CloseTypeBrace, ) private fun SemanticEditorPosition.moveBeforeParenthesesIfPossible(): Boolean = moveBeforeParenthesesIfPossible( leftParenthesis = LeftParenthesis, - rightParenthesis = RightParenthesis + rightParenthesis = RightParenthesis, ) private fun SemanticEditorPosition.moveBeforeParenthesesIfPossible( @@ -187,15 +375,15 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider if (!isAt(rightParenthesis)) return false moveBeforeParentheses(leftParenthesis, rightParenthesis) - moveBeforeIfThisIsWhiteSpaceOrComment() + moveBeforeWhileThisIsWhiteSpaceOrComment() return true } - private fun SemanticEditorPosition.moveBeforeIfThisIsWhiteSpaceOrComment() = moveBeforeOptionalMix(*WHITE_SPACE_OR_COMMENT_BIT_SET) + private fun SemanticEditorPosition.moveBeforeWhileThisIsWhiteSpaceOrComment() = moveBeforeOptionalMix(*WHITE_SPACE_OR_COMMENT_BIT_SET) private fun SemanticEditorPosition.moveBeforeIgnoringWhiteSpaceOrComment() { moveBefore() - moveBeforeIfThisIsWhiteSpaceOrComment() + moveBeforeWhileThisIsWhiteSpaceOrComment() } private enum class KotlinElement : SemanticEditorPosition.SyntaxElement { @@ -206,6 +394,12 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider WhileKeyword, RegularStringPart, KDoc, + Identifier, + OpenTypeBrace, + CloseTypeBrace, + FunctionKeyword, + Dot, + Quest, } companion object { @@ -231,6 +425,14 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider KtTokens.REGULAR_STRING_PART to RegularStringPart, KtTokens.LBRACKET to ArrayOpeningBracket, KtTokens.RBRACKET to ArrayClosingBracket, + KtTokens.IDENTIFIER to Identifier, + KtTokens.LT to OpenTypeBrace, + KtTokens.GT to CloseTypeBrace, + KtTokens.FUN_KEYWORD to FunctionKeyword, + KtTokens.DOT to Dot, + KtTokens.QUEST to Quest, + KtTokens.COMMA to Comma, + KtTokens.COLON to Colon, ) private val CONTROL_FLOW_KEYWORDS: HashSet = hashSetOf( @@ -252,9 +454,10 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider } private fun JavaLikeLangLineIndentProvider.IndentCalculatorFactory.createIndentCalculator( - indent: Indent?, - baseLineOffset: Int -): IndentCalculator? = createIndentCalculator(indent) { baseLineOffset } + indent: Indent, + baseLineOffset: Int, +): IndentCalculator = + createIndentCalculator(indent) { baseLineOffset } ?: error("Contract (null, _ -> null) is broken") private fun SemanticEditorPosition.textOfCurrentPosition(): String = if (isAtEnd) "" else chars.subSequence(startOffset, after().startOffset).toString() \ No newline at end of file diff --git a/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/PerformanceTypingIndentationTestGenerated.java b/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/PerformanceTypingIndentationTestGenerated.java index 2d6caa1a901..1b488860687 100644 --- a/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/PerformanceTypingIndentationTestGenerated.java +++ b/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/PerformanceTypingIndentationTestGenerated.java @@ -208,11 +208,271 @@ public class PerformanceTypingIndentationTestGenerated extends AbstractPerforman runTest("idea/testData/indentationOnNewline/ElseWithoutBrace2.kt"); } + @TestMetadata("EmptyArgumentInCallByReference.kt") + public void testEmptyArgumentInCallByReference() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInCallByReference.kt"); + } + + @TestMetadata("EmptyArgumentInCallByReference2.kt") + public void testEmptyArgumentInCallByReference2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInCallByReference2.kt"); + } + + @TestMetadata("EmptyArgumentInCallByReferenceInSuperType.kt") + public void testEmptyArgumentInCallByReferenceInSuperType() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperType.kt"); + } + + @TestMetadata("EmptyArgumentInCallByReferenceInSuperType2.kt") + public void testEmptyArgumentInCallByReferenceInSuperType2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperType2.kt"); + } + + @TestMetadata("EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments.kt") + public void testEmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments.kt"); + } + + @TestMetadata("EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments2.kt") + public void testEmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments2.kt"); + } + + @TestMetadata("EmptyArgumentInCallByReferenceWithTypeArguments.kt") + public void testEmptyArgumentInCallByReferenceWithTypeArguments() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceWithTypeArguments.kt"); + } + + @TestMetadata("EmptyArgumentInCallByReferenceWithTypeArguments2.kt") + public void testEmptyArgumentInCallByReferenceWithTypeArguments2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceWithTypeArguments2.kt"); + } + + @TestMetadata("EmptyArgumentInThisAsClassicFunction.kt") + public void testEmptyArgumentInThisAsClassicFunction() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInThisAsClassicFunction.kt"); + } + + @TestMetadata("EmptyArgumentInThisAsConstructor.kt") + public void testEmptyArgumentInThisAsConstructor() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInThisAsConstructor.kt"); + } + + @TestMetadata("EmptyArgumentInThisAsConstructor2.kt") + public void testEmptyArgumentInThisAsConstructor2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInThisAsConstructor2.kt"); + } + + @TestMetadata("EmptyConditionInCatch.kt") + public void testEmptyConditionInCatch() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyConditionInCatch.kt"); + } + + @TestMetadata("EmptyConditionInCatch2.kt") + public void testEmptyConditionInCatch2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyConditionInCatch2.kt"); + } + + @TestMetadata("EmptyConditionInDoWhile.kt") + public void testEmptyConditionInDoWhile() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyConditionInDoWhile.kt"); + } + + @TestMetadata("EmptyConditionInFor.kt") + public void testEmptyConditionInFor() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyConditionInFor.kt"); + } + + @TestMetadata("EmptyConditionInIf.kt") + public void testEmptyConditionInIf() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyConditionInIf.kt"); + } + + @TestMetadata("EmptyConditionInWhen.kt") + public void testEmptyConditionInWhen() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyConditionInWhen.kt"); + } + + @TestMetadata("EmptyConditionInWhile.kt") + public void testEmptyConditionInWhile() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyConditionInWhile.kt"); + } + + @TestMetadata("EmptyParameterInAnnonymousFunction.kt") + public void testEmptyParameterInAnnonymousFunction() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunction.kt"); + } + + @TestMetadata("EmptyParameterInAnnonymousFunction2.kt") + public void testEmptyParameterInAnnonymousFunction2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunction2.kt"); + } + + @TestMetadata("EmptyParameterInAnnonymousFunctionWithNullableReceiver.kt") + public void testEmptyParameterInAnnonymousFunctionWithNullableReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithNullableReceiver.kt"); + } + + @TestMetadata("EmptyParameterInAnnonymousFunctionWithNullableReceiver2.kt") + public void testEmptyParameterInAnnonymousFunctionWithNullableReceiver2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithNullableReceiver2.kt"); + } + + @TestMetadata("EmptyParameterInAnnonymousFunctionWithReceiver.kt") + public void testEmptyParameterInAnnonymousFunctionWithReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithReceiver.kt"); + } + + @TestMetadata("EmptyParameterInAnnonymousFunctionWithReceiver2.kt") + public void testEmptyParameterInAnnonymousFunctionWithReceiver2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithReceiver2.kt"); + } + + @TestMetadata("EmptyParameterInDestructuringDeclaration.kt") + public void testEmptyParameterInDestructuringDeclaration() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration.kt"); + } + + @TestMetadata("EmptyParameterInDestructuringDeclaration2.kt") + public void testEmptyParameterInDestructuringDeclaration2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration2.kt"); + } + + @TestMetadata("EmptyParameterInDestructuringDeclaration3.kt") + public void testEmptyParameterInDestructuringDeclaration3() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration3.kt"); + } + + @TestMetadata("EmptyParameterInExplicitPrimaryConstructor.kt") + public void testEmptyParameterInExplicitPrimaryConstructor() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInExplicitPrimaryConstructor.kt"); + } + + @TestMetadata("EmptyParameterInExplicitPrimaryConstructor2.kt") + public void testEmptyParameterInExplicitPrimaryConstructor2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInExplicitPrimaryConstructor2.kt"); + } + + @TestMetadata("EmptyParameterInFunction.kt") + public void testEmptyParameterInFunction() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunction.kt"); + } + + @TestMetadata("EmptyParameterInFunction2.kt") + public void testEmptyParameterInFunction2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunction2.kt"); + } + + @TestMetadata("EmptyParameterInFunctionWithReceiver.kt") + public void testEmptyParameterInFunctionWithReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunctionWithReceiver.kt"); + } + + @TestMetadata("EmptyParameterInFunctionWithReceiver2.kt") + public void testEmptyParameterInFunctionWithReceiver2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunctionWithReceiver2.kt"); + } + + @TestMetadata("EmptyParameterInFunctionWithTypeParameters.kt") + public void testEmptyParameterInFunctionWithTypeParameters() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParameters.kt"); + } + + @TestMetadata("EmptyParameterInFunctionWithTypeParameters2.kt") + public void testEmptyParameterInFunctionWithTypeParameters2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParameters2.kt"); + } + + @TestMetadata("EmptyParameterInFunctionWithTypeParametersAndReceiver.kt") + public void testEmptyParameterInFunctionWithTypeParametersAndReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver.kt"); + } + + @TestMetadata("EmptyParameterInFunctionWithTypeParametersAndReceiver2.kt") + public void testEmptyParameterInFunctionWithTypeParametersAndReceiver2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver2.kt"); + } + + @TestMetadata("EmptyParameterInFunctionWithTypeParametersAndReceiver3.kt") + public void testEmptyParameterInFunctionWithTypeParametersAndReceiver3() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver3.kt"); + } + + @TestMetadata("EmptyParameterInFunctionWithTypeParametersAndReceiver4.kt") + public void testEmptyParameterInFunctionWithTypeParametersAndReceiver4() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver4.kt"); + } + + @TestMetadata("EmptyParameterInGetter.kt") + public void testEmptyParameterInGetter() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInGetter.kt"); + } + + @TestMetadata("EmptyParameterInGetter2.kt") + public void testEmptyParameterInGetter2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInGetter2.kt"); + } + + @TestMetadata("EmptyParameterInImplicitPrimaryConstructor.kt") + public void testEmptyParameterInImplicitPrimaryConstructor() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructor.kt"); + } + + @TestMetadata("EmptyParameterInImplicitPrimaryConstructor2.kt") + public void testEmptyParameterInImplicitPrimaryConstructor2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructor2.kt"); + } + + @TestMetadata("EmptyParameterInImplicitPrimaryConstructorWithTypeParameters.kt") + public void testEmptyParameterInImplicitPrimaryConstructorWithTypeParameters() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructorWithTypeParameters.kt"); + } + + @TestMetadata("EmptyParameterInImplicitPrimaryConstructorWithTypeParameters2.kt") + public void testEmptyParameterInImplicitPrimaryConstructorWithTypeParameters2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructorWithTypeParameters2.kt"); + } + + @TestMetadata("EmptyParameterInInnerAnnonymousFunction.kt") + public void testEmptyParameterInInnerAnnonymousFunction() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInInnerAnnonymousFunction.kt"); + } + + @TestMetadata("EmptyParameterInInnerAnnonymousFunction2.kt") + public void testEmptyParameterInInnerAnnonymousFunction2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInInnerAnnonymousFunction2.kt"); + } + + @TestMetadata("EmptyParameterInSecondaryConstructor.kt") + public void testEmptyParameterInSecondaryConstructor() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInSecondaryConstructor.kt"); + } + + @TestMetadata("EmptyParameterInSecondaryConstructor2.kt") + public void testEmptyParameterInSecondaryConstructor2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInSecondaryConstructor2.kt"); + } + + @TestMetadata("EmptyParameterInSetter.kt") + public void testEmptyParameterInSetter() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInSetter.kt"); + } + + @TestMetadata("EmptyParameterInSetter2.kt") + public void testEmptyParameterInSetter2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInSetter2.kt"); + } + @TestMetadata("EmptyParameters.kt") public void testEmptyParameters() throws Exception { runTest("idea/testData/indentationOnNewline/EmptyParameters.kt"); } + @TestMetadata("EmptyParameters2.kt") + public void testEmptyParameters2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameters2.kt"); + } + @TestMetadata("Finally.kt") public void testFinally() throws Exception { runTest("idea/testData/indentationOnNewline/Finally.kt"); diff --git a/idea/testData/indentationOnNewline/ArgumentListNormalIndent.after.inv.kt b/idea/testData/indentationOnNewline/ArgumentListNormalIndent.after.inv.kt index 6499c399229..a534a6d77b1 100644 --- a/idea/testData/indentationOnNewline/ArgumentListNormalIndent.after.inv.kt +++ b/idea/testData/indentationOnNewline/ArgumentListNormalIndent.after.inv.kt @@ -4,5 +4,4 @@ fun test(i: Int) { ) } -// SET_FALSE: CONTINUATION_INDENT_IN_ARGUMENT_LISTS -// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER \ No newline at end of file +// SET_FALSE: CONTINUATION_INDENT_IN_ARGUMENT_LISTS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/ArgumentListNormalIndent.after.kt b/idea/testData/indentationOnNewline/ArgumentListNormalIndent.after.kt index 0a28f8a3c75..2541e5a16b6 100644 --- a/idea/testData/indentationOnNewline/ArgumentListNormalIndent.after.kt +++ b/idea/testData/indentationOnNewline/ArgumentListNormalIndent.after.kt @@ -4,5 +4,4 @@ fun test(i: Int) { ) } -// SET_FALSE: CONTINUATION_INDENT_IN_ARGUMENT_LISTS -// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER \ No newline at end of file +// SET_FALSE: CONTINUATION_INDENT_IN_ARGUMENT_LISTS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/ArgumentListNormalIndent.kt b/idea/testData/indentationOnNewline/ArgumentListNormalIndent.kt index b1229d9e6af..eb56ec9685d 100644 --- a/idea/testData/indentationOnNewline/ArgumentListNormalIndent.kt +++ b/idea/testData/indentationOnNewline/ArgumentListNormalIndent.kt @@ -2,5 +2,4 @@ fun test(i: Int) { test() } -// SET_FALSE: CONTINUATION_INDENT_IN_ARGUMENT_LISTS -// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER \ No newline at end of file +// SET_FALSE: CONTINUATION_INDENT_IN_ARGUMENT_LISTS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInCallByReference.after.kt b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReference.after.kt new file mode 100644 index 00000000000..1841ba56e2a --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReference.after.kt @@ -0,0 +1,7 @@ +fun a() { + a( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInCallByReference.kt b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReference.kt new file mode 100644 index 00000000000..a927dc8adad --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReference.kt @@ -0,0 +1,5 @@ +fun a() { + a() +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInCallByReference2.after.kt b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReference2.after.kt new file mode 100644 index 00000000000..4507dcabd8a --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReference2.after.kt @@ -0,0 +1,9 @@ +fun a() { + a( + + ) +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInCallByReference2.kt b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReference2.kt new file mode 100644 index 00000000000..255384f0417 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReference2.kt @@ -0,0 +1,7 @@ +fun a() { + a() +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperType.after.kt b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperType.after.kt new file mode 100644 index 00000000000..3bb2dd5e582 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperType.after.kt @@ -0,0 +1,7 @@ +open class A + +class B : A( + +) + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperType.kt b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperType.kt new file mode 100644 index 00000000000..650bd87a42b --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperType.kt @@ -0,0 +1,5 @@ +open class A + +class B : A() + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperType2.after.kt b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperType2.after.kt new file mode 100644 index 00000000000..ebe964f2c19 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperType2.after.kt @@ -0,0 +1,9 @@ +open class A + +class B : A( + + ) + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperType2.kt b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperType2.kt new file mode 100644 index 00000000000..905912ff462 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperType2.kt @@ -0,0 +1,7 @@ +open class A + +class B : A() + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments.after.kt b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments.after.kt new file mode 100644 index 00000000000..f1027bdd2b8 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments.after.kt @@ -0,0 +1,7 @@ +open class A> + +class B : A>( + +) + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments.kt b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments.kt new file mode 100644 index 00000000000..65657b205a1 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments.kt @@ -0,0 +1,5 @@ +open class A> + +class B : A>() + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments2.after.kt b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments2.after.kt new file mode 100644 index 00000000000..de1abf06010 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments2.after.kt @@ -0,0 +1,9 @@ +open class A> + +class B : A>( + + ) + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments2.kt b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments2.kt new file mode 100644 index 00000000000..3f905311dc4 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments2.kt @@ -0,0 +1,7 @@ +open class A> + +class B : A>() + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceWithTypeArguments.after.kt b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceWithTypeArguments.after.kt new file mode 100644 index 00000000000..dd10098c4cf --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceWithTypeArguments.after.kt @@ -0,0 +1,7 @@ +fun test() { + test( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceWithTypeArguments.kt b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceWithTypeArguments.kt new file mode 100644 index 00000000000..7e9bf5e3472 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceWithTypeArguments.kt @@ -0,0 +1,5 @@ +fun test() { + test() +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceWithTypeArguments2.after.kt b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceWithTypeArguments2.after.kt new file mode 100644 index 00000000000..a7cf6575fab --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceWithTypeArguments2.after.kt @@ -0,0 +1,9 @@ +fun test() { + test( + + ) +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceWithTypeArguments2.kt b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceWithTypeArguments2.kt new file mode 100644 index 00000000000..e222f7e2421 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceWithTypeArguments2.kt @@ -0,0 +1,7 @@ +fun test() { + test() +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInThisAsClassicFunction.kt b/idea/testData/indentationOnNewline/EmptyArgumentInThisAsClassicFunction.kt new file mode 100644 index 00000000000..eb812598acf --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInThisAsClassicFunction.kt @@ -0,0 +1,9 @@ +class A { + operator fun invoke() = Unit + + fun a() { + this() + } +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInThisAsConstructor.after.kt b/idea/testData/indentationOnNewline/EmptyArgumentInThisAsConstructor.after.kt new file mode 100644 index 00000000000..e60efae4929 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInThisAsConstructor.after.kt @@ -0,0 +1,7 @@ +class A(a: Int) { + constructor() : this( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInThisAsConstructor.kt b/idea/testData/indentationOnNewline/EmptyArgumentInThisAsConstructor.kt new file mode 100644 index 00000000000..c57d7f1bfaf --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInThisAsConstructor.kt @@ -0,0 +1,5 @@ +class A(a: Int) { + constructor() : this() +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInThisAsConstructor2.after.kt b/idea/testData/indentationOnNewline/EmptyArgumentInThisAsConstructor2.after.kt new file mode 100644 index 00000000000..77ae1b6dfa9 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInThisAsConstructor2.after.kt @@ -0,0 +1,9 @@ +class A(a: Int) { + constructor() : this( + + ) +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyArgumentInThisAsConstructor2.kt b/idea/testData/indentationOnNewline/EmptyArgumentInThisAsConstructor2.kt new file mode 100644 index 00000000000..7a25a3bddb4 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyArgumentInThisAsConstructor2.kt @@ -0,0 +1,7 @@ +class A(a: Int) { + constructor() : this() +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyConditionInCatch.after.kt b/idea/testData/indentationOnNewline/EmptyConditionInCatch.after.kt new file mode 100644 index 00000000000..8eb62050bd9 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyConditionInCatch.after.kt @@ -0,0 +1,9 @@ +fun a() { + try { + + } catch( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyConditionInCatch.kt b/idea/testData/indentationOnNewline/EmptyConditionInCatch.kt new file mode 100644 index 00000000000..085158c8093 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyConditionInCatch.kt @@ -0,0 +1,7 @@ +fun a() { + try { + + } catch() +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyConditionInCatch2.after.kt b/idea/testData/indentationOnNewline/EmptyConditionInCatch2.after.kt new file mode 100644 index 00000000000..d9f3ec35fad --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyConditionInCatch2.after.kt @@ -0,0 +1,11 @@ +fun a() { + try { + + } catch( + + ) +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyConditionInCatch2.kt b/idea/testData/indentationOnNewline/EmptyConditionInCatch2.kt new file mode 100644 index 00000000000..55727ab9757 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyConditionInCatch2.kt @@ -0,0 +1,9 @@ +fun a() { + try { + + } catch() +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyConditionInDoWhile.after.inv.kt b/idea/testData/indentationOnNewline/EmptyConditionInDoWhile.after.inv.kt new file mode 100644 index 00000000000..5a24b1567fb --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyConditionInDoWhile.after.inv.kt @@ -0,0 +1,7 @@ +fun a() { + do println() while ( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyConditionInDoWhile.after.kt b/idea/testData/indentationOnNewline/EmptyConditionInDoWhile.after.kt new file mode 100644 index 00000000000..5a24b1567fb --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyConditionInDoWhile.after.kt @@ -0,0 +1,7 @@ +fun a() { + do println() while ( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyConditionInDoWhile.kt b/idea/testData/indentationOnNewline/EmptyConditionInDoWhile.kt new file mode 100644 index 00000000000..c6c83596420 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyConditionInDoWhile.kt @@ -0,0 +1,5 @@ +fun a() { + do println() while () +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyConditionInFor.after.inv.kt b/idea/testData/indentationOnNewline/EmptyConditionInFor.after.inv.kt new file mode 100644 index 00000000000..0d95bf604de --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyConditionInFor.after.inv.kt @@ -0,0 +1,7 @@ +fun a() { + for ( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyConditionInFor.after.kt b/idea/testData/indentationOnNewline/EmptyConditionInFor.after.kt new file mode 100644 index 00000000000..0d95bf604de --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyConditionInFor.after.kt @@ -0,0 +1,7 @@ +fun a() { + for ( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyConditionInFor.kt b/idea/testData/indentationOnNewline/EmptyConditionInFor.kt new file mode 100644 index 00000000000..134482029e4 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyConditionInFor.kt @@ -0,0 +1,5 @@ +fun a() { + for () +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyConditionInIf.after.inv.kt b/idea/testData/indentationOnNewline/EmptyConditionInIf.after.inv.kt new file mode 100644 index 00000000000..3267e9dfbcd --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyConditionInIf.after.inv.kt @@ -0,0 +1,7 @@ +fun a() { + if ( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyConditionInIf.after.kt b/idea/testData/indentationOnNewline/EmptyConditionInIf.after.kt new file mode 100644 index 00000000000..3267e9dfbcd --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyConditionInIf.after.kt @@ -0,0 +1,7 @@ +fun a() { + if ( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyConditionInIf.kt b/idea/testData/indentationOnNewline/EmptyConditionInIf.kt new file mode 100644 index 00000000000..aefcd0180fd --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyConditionInIf.kt @@ -0,0 +1,5 @@ +fun a() { + if () +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyConditionInWhen.after.inv.kt b/idea/testData/indentationOnNewline/EmptyConditionInWhen.after.inv.kt new file mode 100644 index 00000000000..519cbe81bb0 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyConditionInWhen.after.inv.kt @@ -0,0 +1,7 @@ +fun a() { + when ( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyConditionInWhen.after.kt b/idea/testData/indentationOnNewline/EmptyConditionInWhen.after.kt new file mode 100644 index 00000000000..519cbe81bb0 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyConditionInWhen.after.kt @@ -0,0 +1,7 @@ +fun a() { + when ( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyConditionInWhen.kt b/idea/testData/indentationOnNewline/EmptyConditionInWhen.kt new file mode 100644 index 00000000000..b901183de7a --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyConditionInWhen.kt @@ -0,0 +1,5 @@ +fun a() { + when () +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyConditionInWhile.after.inv.kt b/idea/testData/indentationOnNewline/EmptyConditionInWhile.after.inv.kt new file mode 100644 index 00000000000..a9203936b79 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyConditionInWhile.after.inv.kt @@ -0,0 +1,7 @@ +fun a() { + while ( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyConditionInWhile.after.kt b/idea/testData/indentationOnNewline/EmptyConditionInWhile.after.kt new file mode 100644 index 00000000000..a9203936b79 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyConditionInWhile.after.kt @@ -0,0 +1,7 @@ +fun a() { + while ( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyConditionInWhile.kt b/idea/testData/indentationOnNewline/EmptyConditionInWhile.kt new file mode 100644 index 00000000000..7282c35b5a6 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyConditionInWhile.kt @@ -0,0 +1,5 @@ +fun a() { + while () +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunction.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunction.after.kt new file mode 100644 index 00000000000..0ebcd2d0b14 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunction.after.kt @@ -0,0 +1,8 @@ +class Test { + val a = fun( + + ) +} + + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunction.kt b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunction.kt new file mode 100644 index 00000000000..5874ce22e06 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunction.kt @@ -0,0 +1,6 @@ +class Test { + val a = fun() +} + + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunction2.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunction2.after.kt new file mode 100644 index 00000000000..a982a74f9e8 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunction2.after.kt @@ -0,0 +1,10 @@ +class Test { + val a = fun( + + ) +} + + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunction2.kt b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunction2.kt new file mode 100644 index 00000000000..8d024cd43ad --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunction2.kt @@ -0,0 +1,8 @@ +class Test { + val a = fun() +} + + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithNullableReceiver.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithNullableReceiver.after.kt new file mode 100644 index 00000000000..ebbdee0a080 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithNullableReceiver.after.kt @@ -0,0 +1,8 @@ +class Test { + val a = fun String.Companion????.( + + ) +} + + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithNullableReceiver.kt b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithNullableReceiver.kt new file mode 100644 index 00000000000..9738a2d5c10 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithNullableReceiver.kt @@ -0,0 +1,6 @@ +class Test { + val a = fun String.Companion????.() +} + + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithNullableReceiver2.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithNullableReceiver2.after.kt new file mode 100644 index 00000000000..87f1e66a1f3 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithNullableReceiver2.after.kt @@ -0,0 +1,10 @@ +class Test { + val a = fun String.Companion????.( + + ) +} + + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithNullableReceiver2.kt b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithNullableReceiver2.kt new file mode 100644 index 00000000000..bdd6713eab7 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithNullableReceiver2.kt @@ -0,0 +1,8 @@ +class Test { + val a = fun String.Companion????.() +} + + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithReceiver.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithReceiver.after.kt new file mode 100644 index 00000000000..85299f6d660 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithReceiver.after.kt @@ -0,0 +1,8 @@ +class Test { + val a = fun String.Companion.( + + ) +} + + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithReceiver.kt b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithReceiver.kt new file mode 100644 index 00000000000..988a4ad5433 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithReceiver.kt @@ -0,0 +1,6 @@ +class Test { + val a = fun String.Companion.() +} + + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithReceiver2.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithReceiver2.after.kt new file mode 100644 index 00000000000..0498ee82114 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithReceiver2.after.kt @@ -0,0 +1,10 @@ +class Test { + val a = fun String.Companion.( + + ) +} + + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithReceiver2.kt b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithReceiver2.kt new file mode 100644 index 00000000000..ea7004215de --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithReceiver2.kt @@ -0,0 +1,8 @@ +class Test { + val a = fun String.Companion.() +} + + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration.after.inv.kt b/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration.after.inv.kt new file mode 100644 index 00000000000..92b3ca0c50b --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration.after.inv.kt @@ -0,0 +1,7 @@ +fun a() { + val ( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration.after.kt new file mode 100644 index 00000000000..92b3ca0c50b --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration.after.kt @@ -0,0 +1,7 @@ +fun a() { + val ( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration.kt b/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration.kt new file mode 100644 index 00000000000..c18fb03db29 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration.kt @@ -0,0 +1,5 @@ +fun a() { + val () +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration2.after.inv.kt b/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration2.after.inv.kt new file mode 100644 index 00000000000..988fb887de6 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration2.after.inv.kt @@ -0,0 +1,7 @@ +fun a() { + var ( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration2.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration2.after.kt new file mode 100644 index 00000000000..988fb887de6 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration2.after.kt @@ -0,0 +1,7 @@ +fun a() { + var ( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration2.kt b/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration2.kt new file mode 100644 index 00000000000..120a356ad7a --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration2.kt @@ -0,0 +1,5 @@ +fun a() { + var () +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration3.after.inv.kt b/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration3.after.inv.kt new file mode 100644 index 00000000000..f662fbd0f3d --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration3.after.inv.kt @@ -0,0 +1,7 @@ +fun a() { + a.forEach { ( + + )} +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration3.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration3.after.kt new file mode 100644 index 00000000000..f662fbd0f3d --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration3.after.kt @@ -0,0 +1,7 @@ +fun a() { + a.forEach { ( + + )} +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration3.kt b/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration3.kt new file mode 100644 index 00000000000..bf53834bac0 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration3.kt @@ -0,0 +1,5 @@ +fun a() { + a.forEach { ()} +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInExplicitPrimaryConstructor.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInExplicitPrimaryConstructor.after.kt new file mode 100644 index 00000000000..9c50588245e --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInExplicitPrimaryConstructor.after.kt @@ -0,0 +1,5 @@ +class A private constructor( + +) + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInExplicitPrimaryConstructor.kt b/idea/testData/indentationOnNewline/EmptyParameterInExplicitPrimaryConstructor.kt new file mode 100644 index 00000000000..69cfca7d9ba --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInExplicitPrimaryConstructor.kt @@ -0,0 +1,3 @@ +class A private constructor() + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInExplicitPrimaryConstructor2.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInExplicitPrimaryConstructor2.after.kt new file mode 100644 index 00000000000..0fd65c89034 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInExplicitPrimaryConstructor2.after.kt @@ -0,0 +1,7 @@ +class A private constructor( + + ) + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInExplicitPrimaryConstructor2.kt b/idea/testData/indentationOnNewline/EmptyParameterInExplicitPrimaryConstructor2.kt new file mode 100644 index 00000000000..14a8895a47d --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInExplicitPrimaryConstructor2.kt @@ -0,0 +1,5 @@ +class A private constructor() + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunction.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunction.after.kt new file mode 100644 index 00000000000..b4194c427aa --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunction.after.kt @@ -0,0 +1,8 @@ +class A { + fun testParam( + + ) { + } +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunction.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunction.kt new file mode 100644 index 00000000000..6625f9e9ddf --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunction.kt @@ -0,0 +1,6 @@ +class A { + fun testParam() { + } +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunction2.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunction2.after.kt new file mode 100644 index 00000000000..3d2a0a32a4f --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunction2.after.kt @@ -0,0 +1,10 @@ +class A { + fun testParam( + + ) { + } +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunction2.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunction2.kt new file mode 100644 index 00000000000..69cf2246211 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunction2.kt @@ -0,0 +1,8 @@ +class A { + fun testParam() { + } +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithReceiver.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithReceiver.after.kt new file mode 100644 index 00000000000..1a12b66ccab --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithReceiver.after.kt @@ -0,0 +1,8 @@ +class A { + fun String.Companion.testParam( + + ) { + } +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithReceiver.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithReceiver.kt new file mode 100644 index 00000000000..a21c0564f0e --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithReceiver.kt @@ -0,0 +1,6 @@ +class A { + fun String.Companion.testParam() { + } +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithReceiver2.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithReceiver2.after.kt new file mode 100644 index 00000000000..75269d764a0 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithReceiver2.after.kt @@ -0,0 +1,10 @@ +class A { + fun String.Companion.testParam( + + ) { + } +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithReceiver2.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithReceiver2.kt new file mode 100644 index 00000000000..7806720619d --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithReceiver2.kt @@ -0,0 +1,8 @@ +class A { + fun String.Companion.testParam() { + } +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParameters.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParameters.after.kt new file mode 100644 index 00000000000..b233b18063e --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParameters.after.kt @@ -0,0 +1,8 @@ +class A { + fun testParam( + + ) { + } +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParameters.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParameters.kt new file mode 100644 index 00000000000..70492a02e1e --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParameters.kt @@ -0,0 +1,6 @@ +class A { + fun testParam() { + } +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParameters2.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParameters2.after.kt new file mode 100644 index 00000000000..a19d946b91d --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParameters2.after.kt @@ -0,0 +1,10 @@ +class A { + fun testParam( + + ) { + } +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParameters2.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParameters2.kt new file mode 100644 index 00000000000..5f17624ea48 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParameters2.kt @@ -0,0 +1,8 @@ +class A { + fun testParam() { + } +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver.after.kt new file mode 100644 index 00000000000..2cb38cbec0b --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver.after.kt @@ -0,0 +1,8 @@ +class A { + fun Int.Companion.testParam( + + ) { + } +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver.kt new file mode 100644 index 00000000000..01fe4b89f72 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver.kt @@ -0,0 +1,6 @@ +class A { + fun Int.Companion.testParam() { + } +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver2.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver2.after.kt new file mode 100644 index 00000000000..41bdc0f36b0 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver2.after.kt @@ -0,0 +1,7 @@ +class A { + fun List?.testFunction( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver2.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver2.kt new file mode 100644 index 00000000000..a442f16c9ff --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver2.kt @@ -0,0 +1,5 @@ +class A { + fun List?.testFunction() +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver3.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver3.after.kt new file mode 100644 index 00000000000..b14b5536286 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver3.after.kt @@ -0,0 +1,10 @@ +class A { + fun Int.Companion.testParam( + + ) { + } +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver3.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver3.kt new file mode 100644 index 00000000000..3b133514101 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver3.kt @@ -0,0 +1,8 @@ +class A { + fun Int.Companion.testParam() { + } +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver4.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver4.after.kt new file mode 100644 index 00000000000..aa0a39560f3 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver4.after.kt @@ -0,0 +1,9 @@ +class A { + fun List?.testFunction( + + ) +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver4.kt b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver4.kt new file mode 100644 index 00000000000..bda37730182 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver4.kt @@ -0,0 +1,7 @@ +class A { + fun List?.testFunction() +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInGetter.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInGetter.after.kt new file mode 100644 index 00000000000..1367515c026 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInGetter.after.kt @@ -0,0 +1,8 @@ +class Test { + val a: Boolean get( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS +// KT-39444 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInGetter.kt b/idea/testData/indentationOnNewline/EmptyParameterInGetter.kt new file mode 100644 index 00000000000..dd49e5677b8 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInGetter.kt @@ -0,0 +1,6 @@ +class Test { + val a: Boolean get() +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS +// KT-39444 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInGetter2.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInGetter2.after.kt new file mode 100644 index 00000000000..b3e09b39c8f --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInGetter2.after.kt @@ -0,0 +1,9 @@ +class Test { + val a: Boolean get( + + ) +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39444 diff --git a/idea/testData/indentationOnNewline/EmptyParameterInGetter2.kt b/idea/testData/indentationOnNewline/EmptyParameterInGetter2.kt new file mode 100644 index 00000000000..1ef654d1762 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInGetter2.kt @@ -0,0 +1,7 @@ +class Test { + val a: Boolean get() +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39444 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructor.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructor.after.kt new file mode 100644 index 00000000000..9f5ecf660af --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructor.after.kt @@ -0,0 +1,5 @@ +class A( + +) + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructor.kt b/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructor.kt new file mode 100644 index 00000000000..1cb25cbbace --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructor.kt @@ -0,0 +1,3 @@ +class A() + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructor2.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructor2.after.kt new file mode 100644 index 00000000000..3aab17b79e3 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructor2.after.kt @@ -0,0 +1,7 @@ +class A( + + ) + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructor2.kt b/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructor2.kt new file mode 100644 index 00000000000..20b86d08753 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructor2.kt @@ -0,0 +1,5 @@ +class A() + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructorWithTypeParameters.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructorWithTypeParameters.after.kt new file mode 100644 index 00000000000..d0331b2f108 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructorWithTypeParameters.after.kt @@ -0,0 +1,5 @@ +class A( + +) + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructorWithTypeParameters.kt b/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructorWithTypeParameters.kt new file mode 100644 index 00000000000..6b2a5bce061 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructorWithTypeParameters.kt @@ -0,0 +1,3 @@ +class A() + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructorWithTypeParameters2.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructorWithTypeParameters2.after.kt new file mode 100644 index 00000000000..ba666bfe9bb --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructorWithTypeParameters2.after.kt @@ -0,0 +1,7 @@ +class A( + + ) + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructorWithTypeParameters2.kt b/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructorWithTypeParameters2.kt new file mode 100644 index 00000000000..add27902f5a --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructorWithTypeParameters2.kt @@ -0,0 +1,5 @@ +class A() + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInInnerAnnonymousFunction.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInInnerAnnonymousFunction.after.kt new file mode 100644 index 00000000000..6fe1a4e8a1e --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInInnerAnnonymousFunction.after.kt @@ -0,0 +1,9 @@ +class Test { + fun a( + action: () -> Unit = fun( + + )) +} + + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInInnerAnnonymousFunction.kt b/idea/testData/indentationOnNewline/EmptyParameterInInnerAnnonymousFunction.kt new file mode 100644 index 00000000000..23b0dc2415b --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInInnerAnnonymousFunction.kt @@ -0,0 +1,7 @@ +class Test { + fun a( + action: () -> Unit = fun()) +} + + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInInnerAnnonymousFunction2.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInInnerAnnonymousFunction2.after.kt new file mode 100644 index 00000000000..e75856eb5b2 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInInnerAnnonymousFunction2.after.kt @@ -0,0 +1,11 @@ +class Test { + fun a( + action: () -> Unit = fun( + + )) +} + + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInInnerAnnonymousFunction2.kt b/idea/testData/indentationOnNewline/EmptyParameterInInnerAnnonymousFunction2.kt new file mode 100644 index 00000000000..3df2f77d879 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInInnerAnnonymousFunction2.kt @@ -0,0 +1,9 @@ +class Test { + fun a( + action: () -> Unit = fun()) +} + + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInSecondaryConstructor.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInSecondaryConstructor.after.kt new file mode 100644 index 00000000000..5806fae60c0 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInSecondaryConstructor.after.kt @@ -0,0 +1,7 @@ +class A { + constructor( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInSecondaryConstructor.kt b/idea/testData/indentationOnNewline/EmptyParameterInSecondaryConstructor.kt new file mode 100644 index 00000000000..00f55d5a644 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInSecondaryConstructor.kt @@ -0,0 +1,5 @@ +class A { + constructor() +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInSecondaryConstructor2.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInSecondaryConstructor2.after.kt new file mode 100644 index 00000000000..9599f19842b --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInSecondaryConstructor2.after.kt @@ -0,0 +1,9 @@ +class A { + constructor( + + ) +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInSecondaryConstructor2.kt b/idea/testData/indentationOnNewline/EmptyParameterInSecondaryConstructor2.kt new file mode 100644 index 00000000000..d459c21394d --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInSecondaryConstructor2.kt @@ -0,0 +1,7 @@ +class A { + constructor() +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInSetter.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInSetter.after.kt new file mode 100644 index 00000000000..db693957e99 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInSetter.after.kt @@ -0,0 +1,9 @@ +class Test { + var a: Boolean + get() = false + set( + + ) +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInSetter.kt b/idea/testData/indentationOnNewline/EmptyParameterInSetter.kt new file mode 100644 index 00000000000..a856508dd39 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInSetter.kt @@ -0,0 +1,7 @@ +class Test { + var a: Boolean + get() = false + set() +} + +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInSetter2.after.kt b/idea/testData/indentationOnNewline/EmptyParameterInSetter2.after.kt new file mode 100644 index 00000000000..c4efd863220 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInSetter2.after.kt @@ -0,0 +1,10 @@ +class Test { + var a: Boolean + get() = false + set( + + ) +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameterInSetter2.kt b/idea/testData/indentationOnNewline/EmptyParameterInSetter2.kt new file mode 100644 index 00000000000..bfc50b6060c --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameterInSetter2.kt @@ -0,0 +1,8 @@ +class Test { + var a: Boolean + get() = false + set() +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameters.after.kt b/idea/testData/indentationOnNewline/EmptyParameters.after.kt index 14699949048..49aa60a5be4 100644 --- a/idea/testData/indentationOnNewline/EmptyParameters.after.kt +++ b/idea/testData/indentationOnNewline/EmptyParameters.after.kt @@ -3,4 +3,4 @@ fun testParam( ) { } -// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER \ No newline at end of file +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameters.kt b/idea/testData/indentationOnNewline/EmptyParameters.kt index 7a646ee3cdd..8b19e7797bb 100644 --- a/idea/testData/indentationOnNewline/EmptyParameters.kt +++ b/idea/testData/indentationOnNewline/EmptyParameters.kt @@ -1,4 +1,4 @@ fun testParam() { } -// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER \ No newline at end of file +// SET_FALSE: ALIGN_MULTILINE_METHOD_BRACKETS \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameters2.after.kt b/idea/testData/indentationOnNewline/EmptyParameters2.after.kt new file mode 100644 index 00000000000..19b7a3a76ef --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameters2.after.kt @@ -0,0 +1,8 @@ +fun testParam( + + ) { +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/EmptyParameters2.kt b/idea/testData/indentationOnNewline/EmptyParameters2.kt new file mode 100644 index 00000000000..e9cb5c953e7 --- /dev/null +++ b/idea/testData/indentationOnNewline/EmptyParameters2.kt @@ -0,0 +1,6 @@ +fun testParam() { +} + +// SET_TRUE: ALIGN_MULTILINE_METHOD_BRACKETS +// IGNORE_FORMATTER +// KT-39459 \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/formatter/TypingIndentationTestBaseGenerated.java b/idea/tests/org/jetbrains/kotlin/formatter/TypingIndentationTestBaseGenerated.java index eb7eb2e7355..bc16660aba3 100644 --- a/idea/tests/org/jetbrains/kotlin/formatter/TypingIndentationTestBaseGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/formatter/TypingIndentationTestBaseGenerated.java @@ -210,11 +210,266 @@ public class TypingIndentationTestBaseGenerated extends AbstractTypingIndentatio runTest("idea/testData/indentationOnNewline/ElseWithoutBrace2.after.kt"); } + @TestMetadata("EmptyArgumentInCallByReference.after.kt") + public void testEmptyArgumentInCallByReference() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInCallByReference.after.kt"); + } + + @TestMetadata("EmptyArgumentInCallByReference2.after.kt") + public void testEmptyArgumentInCallByReference2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInCallByReference2.after.kt"); + } + + @TestMetadata("EmptyArgumentInCallByReferenceInSuperType.after.kt") + public void testEmptyArgumentInCallByReferenceInSuperType() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperType.after.kt"); + } + + @TestMetadata("EmptyArgumentInCallByReferenceInSuperType2.after.kt") + public void testEmptyArgumentInCallByReferenceInSuperType2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperType2.after.kt"); + } + + @TestMetadata("EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments.after.kt") + public void testEmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments.after.kt"); + } + + @TestMetadata("EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments2.after.kt") + public void testEmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceInSuperTypeWithTypeArguments2.after.kt"); + } + + @TestMetadata("EmptyArgumentInCallByReferenceWithTypeArguments.after.kt") + public void testEmptyArgumentInCallByReferenceWithTypeArguments() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceWithTypeArguments.after.kt"); + } + + @TestMetadata("EmptyArgumentInCallByReferenceWithTypeArguments2.after.kt") + public void testEmptyArgumentInCallByReferenceWithTypeArguments2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInCallByReferenceWithTypeArguments2.after.kt"); + } + + @TestMetadata("EmptyArgumentInThisAsConstructor.after.kt") + public void testEmptyArgumentInThisAsConstructor() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInThisAsConstructor.after.kt"); + } + + @TestMetadata("EmptyArgumentInThisAsConstructor2.after.kt") + public void testEmptyArgumentInThisAsConstructor2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyArgumentInThisAsConstructor2.after.kt"); + } + + @TestMetadata("EmptyConditionInCatch.after.kt") + public void testEmptyConditionInCatch() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyConditionInCatch.after.kt"); + } + + @TestMetadata("EmptyConditionInCatch2.after.kt") + public void testEmptyConditionInCatch2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyConditionInCatch2.after.kt"); + } + + @TestMetadata("EmptyConditionInDoWhile.after.kt") + public void testEmptyConditionInDoWhile() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyConditionInDoWhile.after.kt"); + } + + @TestMetadata("EmptyConditionInFor.after.kt") + public void testEmptyConditionInFor() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyConditionInFor.after.kt"); + } + + @TestMetadata("EmptyConditionInIf.after.kt") + public void testEmptyConditionInIf() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyConditionInIf.after.kt"); + } + + @TestMetadata("EmptyConditionInWhen.after.kt") + public void testEmptyConditionInWhen() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyConditionInWhen.after.kt"); + } + + @TestMetadata("EmptyConditionInWhile.after.kt") + public void testEmptyConditionInWhile() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyConditionInWhile.after.kt"); + } + + @TestMetadata("EmptyParameterInAnnonymousFunction.after.kt") + public void testEmptyParameterInAnnonymousFunction() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunction.after.kt"); + } + + @TestMetadata("EmptyParameterInAnnonymousFunction2.after.kt") + public void testEmptyParameterInAnnonymousFunction2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunction2.after.kt"); + } + + @TestMetadata("EmptyParameterInAnnonymousFunctionWithNullableReceiver.after.kt") + public void testEmptyParameterInAnnonymousFunctionWithNullableReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithNullableReceiver.after.kt"); + } + + @TestMetadata("EmptyParameterInAnnonymousFunctionWithNullableReceiver2.after.kt") + public void testEmptyParameterInAnnonymousFunctionWithNullableReceiver2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithNullableReceiver2.after.kt"); + } + + @TestMetadata("EmptyParameterInAnnonymousFunctionWithReceiver.after.kt") + public void testEmptyParameterInAnnonymousFunctionWithReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithReceiver.after.kt"); + } + + @TestMetadata("EmptyParameterInAnnonymousFunctionWithReceiver2.after.kt") + public void testEmptyParameterInAnnonymousFunctionWithReceiver2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInAnnonymousFunctionWithReceiver2.after.kt"); + } + + @TestMetadata("EmptyParameterInDestructuringDeclaration.after.kt") + public void testEmptyParameterInDestructuringDeclaration() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration.after.kt"); + } + + @TestMetadata("EmptyParameterInDestructuringDeclaration2.after.kt") + public void testEmptyParameterInDestructuringDeclaration2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration2.after.kt"); + } + + @TestMetadata("EmptyParameterInDestructuringDeclaration3.after.kt") + public void testEmptyParameterInDestructuringDeclaration3() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration3.after.kt"); + } + + @TestMetadata("EmptyParameterInExplicitPrimaryConstructor.after.kt") + public void testEmptyParameterInExplicitPrimaryConstructor() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInExplicitPrimaryConstructor.after.kt"); + } + + @TestMetadata("EmptyParameterInExplicitPrimaryConstructor2.after.kt") + public void testEmptyParameterInExplicitPrimaryConstructor2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInExplicitPrimaryConstructor2.after.kt"); + } + + @TestMetadata("EmptyParameterInFunction.after.kt") + public void testEmptyParameterInFunction() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunction.after.kt"); + } + + @TestMetadata("EmptyParameterInFunction2.after.kt") + public void testEmptyParameterInFunction2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunction2.after.kt"); + } + + @TestMetadata("EmptyParameterInFunctionWithReceiver.after.kt") + public void testEmptyParameterInFunctionWithReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunctionWithReceiver.after.kt"); + } + + @TestMetadata("EmptyParameterInFunctionWithReceiver2.after.kt") + public void testEmptyParameterInFunctionWithReceiver2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunctionWithReceiver2.after.kt"); + } + + @TestMetadata("EmptyParameterInFunctionWithTypeParameters.after.kt") + public void testEmptyParameterInFunctionWithTypeParameters() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParameters.after.kt"); + } + + @TestMetadata("EmptyParameterInFunctionWithTypeParameters2.after.kt") + public void testEmptyParameterInFunctionWithTypeParameters2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParameters2.after.kt"); + } + + @TestMetadata("EmptyParameterInFunctionWithTypeParametersAndReceiver.after.kt") + public void testEmptyParameterInFunctionWithTypeParametersAndReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver.after.kt"); + } + + @TestMetadata("EmptyParameterInFunctionWithTypeParametersAndReceiver2.after.kt") + public void testEmptyParameterInFunctionWithTypeParametersAndReceiver2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver2.after.kt"); + } + + @TestMetadata("EmptyParameterInFunctionWithTypeParametersAndReceiver3.after.kt") + public void testEmptyParameterInFunctionWithTypeParametersAndReceiver3() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver3.after.kt"); + } + + @TestMetadata("EmptyParameterInFunctionWithTypeParametersAndReceiver4.after.kt") + public void testEmptyParameterInFunctionWithTypeParametersAndReceiver4() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInFunctionWithTypeParametersAndReceiver4.after.kt"); + } + + @TestMetadata("EmptyParameterInGetter.after.kt") + public void testEmptyParameterInGetter() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInGetter.after.kt"); + } + + @TestMetadata("EmptyParameterInGetter2.after.kt") + public void testEmptyParameterInGetter2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInGetter2.after.kt"); + } + + @TestMetadata("EmptyParameterInImplicitPrimaryConstructor.after.kt") + public void testEmptyParameterInImplicitPrimaryConstructor() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructor.after.kt"); + } + + @TestMetadata("EmptyParameterInImplicitPrimaryConstructor2.after.kt") + public void testEmptyParameterInImplicitPrimaryConstructor2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructor2.after.kt"); + } + + @TestMetadata("EmptyParameterInImplicitPrimaryConstructorWithTypeParameters.after.kt") + public void testEmptyParameterInImplicitPrimaryConstructorWithTypeParameters() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructorWithTypeParameters.after.kt"); + } + + @TestMetadata("EmptyParameterInImplicitPrimaryConstructorWithTypeParameters2.after.kt") + public void testEmptyParameterInImplicitPrimaryConstructorWithTypeParameters2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInImplicitPrimaryConstructorWithTypeParameters2.after.kt"); + } + + @TestMetadata("EmptyParameterInInnerAnnonymousFunction.after.kt") + public void testEmptyParameterInInnerAnnonymousFunction() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInInnerAnnonymousFunction.after.kt"); + } + + @TestMetadata("EmptyParameterInInnerAnnonymousFunction2.after.kt") + public void testEmptyParameterInInnerAnnonymousFunction2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInInnerAnnonymousFunction2.after.kt"); + } + + @TestMetadata("EmptyParameterInSecondaryConstructor.after.kt") + public void testEmptyParameterInSecondaryConstructor() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInSecondaryConstructor.after.kt"); + } + + @TestMetadata("EmptyParameterInSecondaryConstructor2.after.kt") + public void testEmptyParameterInSecondaryConstructor2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInSecondaryConstructor2.after.kt"); + } + + @TestMetadata("EmptyParameterInSetter.after.kt") + public void testEmptyParameterInSetter() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInSetter.after.kt"); + } + + @TestMetadata("EmptyParameterInSetter2.after.kt") + public void testEmptyParameterInSetter2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInSetter2.after.kt"); + } + @TestMetadata("EmptyParameters.after.kt") public void testEmptyParameters() throws Exception { runTest("idea/testData/indentationOnNewline/EmptyParameters.after.kt"); } + @TestMetadata("EmptyParameters2.after.kt") + public void testEmptyParameters2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameters2.after.kt"); + } + @TestMetadata("Finally.after.kt") public void testFinally() throws Exception { runTest("idea/testData/indentationOnNewline/Finally.after.kt"); @@ -716,6 +971,46 @@ public class TypingIndentationTestBaseGenerated extends AbstractTypingIndentatio runTest("idea/testData/indentationOnNewline/BinaryWithTypeExpressions.after.inv.kt"); } + @TestMetadata("EmptyConditionInDoWhile.after.inv.kt") + public void testEmptyConditionInDoWhile() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyConditionInDoWhile.after.inv.kt"); + } + + @TestMetadata("EmptyConditionInFor.after.inv.kt") + public void testEmptyConditionInFor() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyConditionInFor.after.inv.kt"); + } + + @TestMetadata("EmptyConditionInIf.after.inv.kt") + public void testEmptyConditionInIf() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyConditionInIf.after.inv.kt"); + } + + @TestMetadata("EmptyConditionInWhen.after.inv.kt") + public void testEmptyConditionInWhen() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyConditionInWhen.after.inv.kt"); + } + + @TestMetadata("EmptyConditionInWhile.after.inv.kt") + public void testEmptyConditionInWhile() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyConditionInWhile.after.inv.kt"); + } + + @TestMetadata("EmptyParameterInDestructuringDeclaration.after.inv.kt") + public void testEmptyParameterInDestructuringDeclaration() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration.after.inv.kt"); + } + + @TestMetadata("EmptyParameterInDestructuringDeclaration2.after.inv.kt") + public void testEmptyParameterInDestructuringDeclaration2() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration2.after.inv.kt"); + } + + @TestMetadata("EmptyParameterInDestructuringDeclaration3.after.inv.kt") + public void testEmptyParameterInDestructuringDeclaration3() throws Exception { + runTest("idea/testData/indentationOnNewline/EmptyParameterInDestructuringDeclaration3.after.inv.kt"); + } + @TestMetadata("InBinaryExpressionInMiddle.after.inv.kt") public void testInBinaryExpressionInMiddle() throws Exception { runTest("idea/testData/indentationOnNewline/InBinaryExpressionInMiddle.after.inv.kt");