From 447549f20ddaeababe656dc0cff3afa204aed396 Mon Sep 17 00:00:00 2001 From: Dmitry Gridin Date: Tue, 9 Jun 2020 21:42:56 +0700 Subject: [PATCH] LineIndentProvider: support declarations with body expression Part of #KT-22211 --- .../lineIndent/KotlinIndentationAdjuster.kt | 4 + .../KotlinLikeLangLineIndentProvider.kt | 99 ++++++-- ...ormanceTypingIndentationTestGenerated.java | 123 ++++++++-- .../formatter/KotlinLineIndentProvider.kt | 3 + .../FunctionWithInference.after.kt | 4 - .../FunctionWithInference.kt | 3 - .../MultideclarationAfterEq.after.kt | 6 - .../MultideclarationAfterEq.kt | 5 - .../MultideclarationBeforeEq.after.kt | 6 - .../MultideclarationBeforeEq.kt | 5 - .../PropertyWithInference.after.kt | 4 - .../PropertyWithInference.kt | 3 - ...AfterFunctionWithExplicitType.after.inv.kt | 4 + .../AfterFunctionWithExplicitType.after.kt | 4 + .../AfterFunctionWithExplicitType.kt | 3 + .../AfterFunctionWithInference.after.inv.kt | 4 + .../AfterFunctionWithInference.after.kt | 4 + .../AfterFunctionWithInference.kt | 3 + ...fterFunctionWithTypeParameter.after.inv.kt | 3 + .../AfterFunctionWithTypeParameter.after.kt | 3 + .../AfterFunctionWithTypeParameter.kt | 2 + .../AfterMultideclaration.after.inv.kt | 6 + .../AfterMultideclaration.after.kt | 6 + .../expressionBody/AfterMultideclaration.kt | 5 + .../AfterMutableProperty.after.inv.kt | 5 + .../AfterMutableProperty.after.kt | 5 + .../expressionBody/AfterMutableProperty.kt | 4 + ...AfterPropertyWithExplicitType.after.inv.kt | 4 + .../AfterPropertyWithExplicitType.after.kt | 4 + .../AfterPropertyWithExplicitType.kt | 3 + .../AfterPropertyWithInference.after.inv.kt | 4 + .../AfterPropertyWithInference.after.kt | 4 + .../AfterPropertyWithInference.kt | 3 + .../AfterPropertyWithReceiver.after.inv.kt | 4 + .../AfterPropertyWithReceiver.after.kt | 4 + .../AfterPropertyWithReceiver.kt | 3 + ...ertyWithTypeParameterReceiver.after.inv.kt | 4 + ...PropertyWithTypeParameterReceiver.after.kt | 4 + .../AfterPropertyWithTypeParameterReceiver.kt | 3 + .../FunctionWithExplicitType.after.inv.kt | 4 + .../FunctionWithExplicitType.after.kt | 4 + .../FunctionWithExplicitType.kt | 3 + .../FunctionWithInference.after.inv.kt | 4 + .../FunctionWithInference.after.kt | 4 + .../expressionBody/FunctionWithInference.kt | 3 + .../FunctionWithTypeParameter.after.inv.kt | 4 + .../FunctionWithTypeParameter.after.kt | 4 + .../FunctionWithTypeParameter.kt | 3 + .../Multideclaration.after.inv.kt | 6 + .../expressionBody/Multideclaration.after.kt | 6 + .../expressionBody/Multideclaration.kt | 5 + .../MutableProperty.after.inv.kt | 5 + .../expressionBody/MutableProperty.after.kt | 5 + .../expressionBody/MutableProperty.kt | 4 + .../PropertyWithExplicitType.after.inv.kt | 4 + .../PropertyWithExplicitType.after.kt | 4 + .../PropertyWithExplicitType.kt | 3 + .../PropertyWithInference.after.inv.kt | 4 + .../PropertyWithInference.after.kt | 4 + .../expressionBody/PropertyWithInference.kt | 3 + .../PropertyWithReceiver.after.inv.kt | 4 + .../PropertyWithReceiver.after.kt | 4 + .../expressionBody/PropertyWithReceiver.kt | 3 + ...ertyWithTypeParameterReceiver.after.inv.kt | 4 + ...PropertyWithTypeParameterReceiver.after.kt | 4 + .../PropertyWithTypeParameterReceiver.kt | 3 + .../TypingIndentationTestBaseGenerated.java | 226 ++++++++++++++++-- 67 files changed, 611 insertions(+), 93 deletions(-) delete mode 100644 idea/testData/indentationOnNewline/FunctionWithInference.after.kt delete mode 100644 idea/testData/indentationOnNewline/FunctionWithInference.kt delete mode 100644 idea/testData/indentationOnNewline/MultideclarationAfterEq.after.kt delete mode 100644 idea/testData/indentationOnNewline/MultideclarationAfterEq.kt delete mode 100644 idea/testData/indentationOnNewline/MultideclarationBeforeEq.after.kt delete mode 100644 idea/testData/indentationOnNewline/MultideclarationBeforeEq.kt delete mode 100644 idea/testData/indentationOnNewline/PropertyWithInference.after.kt delete mode 100644 idea/testData/indentationOnNewline/PropertyWithInference.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithExplicitType.after.inv.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithExplicitType.after.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithExplicitType.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithInference.after.inv.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithInference.after.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithInference.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithTypeParameter.after.inv.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithTypeParameter.after.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithTypeParameter.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterMultideclaration.after.inv.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterMultideclaration.after.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterMultideclaration.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterMutableProperty.after.inv.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterMutableProperty.after.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterMutableProperty.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithExplicitType.after.inv.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithExplicitType.after.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithExplicitType.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithInference.after.inv.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithInference.after.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithInference.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithReceiver.after.inv.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithReceiver.after.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithReceiver.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithTypeParameterReceiver.after.inv.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithTypeParameterReceiver.after.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithTypeParameterReceiver.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/FunctionWithExplicitType.after.inv.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/FunctionWithExplicitType.after.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/FunctionWithExplicitType.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/FunctionWithInference.after.inv.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/FunctionWithInference.after.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/FunctionWithInference.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/FunctionWithTypeParameter.after.inv.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/FunctionWithTypeParameter.after.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/FunctionWithTypeParameter.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/Multideclaration.after.inv.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/Multideclaration.after.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/Multideclaration.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/MutableProperty.after.inv.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/MutableProperty.after.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/MutableProperty.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/PropertyWithExplicitType.after.inv.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/PropertyWithExplicitType.after.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/PropertyWithExplicitType.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/PropertyWithInference.after.inv.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/PropertyWithInference.after.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/PropertyWithInference.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/PropertyWithReceiver.after.inv.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/PropertyWithReceiver.after.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/PropertyWithReceiver.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/PropertyWithTypeParameterReceiver.after.inv.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/PropertyWithTypeParameterReceiver.after.kt create mode 100644 idea/testData/indentationOnNewline/expressionBody/PropertyWithTypeParameterReceiver.kt diff --git a/idea/line-indent-provider/src/org/jetbrains/kotlin/idea/formatter/lineIndent/KotlinIndentationAdjuster.kt b/idea/line-indent-provider/src/org/jetbrains/kotlin/idea/formatter/lineIndent/KotlinIndentationAdjuster.kt index 656840b82aa..1bd238ce9d2 100644 --- a/idea/line-indent-provider/src/org/jetbrains/kotlin/idea/formatter/lineIndent/KotlinIndentationAdjuster.kt +++ b/idea/line-indent-provider/src/org/jetbrains/kotlin/idea/formatter/lineIndent/KotlinIndentationAdjuster.kt @@ -17,4 +17,8 @@ interface KotlinIndentationAdjuster { // CONTINUATION_INDENT_IN_ELVIS val continuationIndentInElvis: Boolean get() = false + + // CONTINUATION_INDENT_FOR_EXPRESSION_BODIES + val continuationIndentForExpressionBodies: Boolean + get() = false } \ No newline at end of file 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 fa53d17ec27..cea091d1ad6 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 @@ -98,12 +98,28 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider return factory.createIndentCalculator(indent, after.startOffset) } + before.isAt(Eq) -> { + val declaration = findFunctionOrPropertyDeclarationBefore(before.copyAnd { it.moveBeforeIgnoringWhiteSpaceOrComment() }) + if (declaration != null) { + val indent = if (settings.continuationIndentForExpressionBodies) + Indent.getContinuationIndent() + else + Indent.getNormalIndent() + + return factory.createIndentCalculator(indent, declaration.startOffset) + } + } + before.isAt(LeftParenthesis) && after.isAt(RightParenthesis) -> { val indentCalculator = factory.createIndentCalculatorForParenthesis(before, currentPosition, after, offset, settings) if (indentCalculator != null) return indentCalculator } } + findFunctionOrPropertyDeclarationBefore(before)?.let { + return factory.createIndentCalculator(Indent.getNoneIndent(), it.startOffset) + } + return before.controlFlowStatementBefore()?.let { controlFlowKeywordPosition -> val indent = when { controlFlowKeywordPosition.similarToCatchKeyword() -> if (before.isAt(RightParenthesis)) Indent.getNoneIndent() else Indent.getNormalIndent() @@ -132,9 +148,8 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider if (settings.alignWhenMultilineFunctionParentheses) createAlignMultilineIndent(leftParenthesis) else Indent.getNoneIndent() } - val functionKeyword = findFunctionDeclarationBefore(leftParenthesis) - if (functionKeyword != null) { - return createIndentCalculator(indentForParentheses, functionKeyword.startOffset) + findFunctionKeywordBeforeIdentifier(leftParenthesis.copyAnd { it.moveBeforeIgnoringWhiteSpaceOrComment() })?.let { + return createIndentCalculator(indentForParentheses, it.startOffset) } // NB: this covered [KtTokens.CONSTRUCTOR_KEYWORD], [KtTokens.SET_KEYWORD], [KtTokens.GET_KEYWORD], [KtTokens.INIT_KEYWORD] as well @@ -163,35 +178,74 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider return null } + /** + * @param declarationPosition is position before '=' for expression body or '{' + */ + private fun findFunctionOrPropertyDeclarationBefore(declarationPosition: SemanticEditorPosition): SemanticEditorPosition? { + // `val a = 5` + // this is false positive for declaration with explicit return type + if (declarationPosition.isAt(Identifier)) { + findPropertyKeywordBeforeIdentifier(declarationPosition)?.let { return it } + } + + return with(declarationPosition.copy()) { + // explicit type `fun a(): String` or `val a: String` + if (moveBeforeTypeQualifierIfPossible(true)) { + if (!isAt(Colon)) return null + moveBeforeIgnoringWhiteSpaceOrComment() + } + + if (isAt(RightParenthesis)) { + if (!moveBeforeParenthesesIfPossible()) return null + + // destructuring declaration `val (a, b)` + if (isVarOrVal()) + this + else + findFunctionKeywordBeforeIdentifier(this) + } else { + findPropertyKeywordBeforeIdentifier(this) + } + } + } + + private fun findPropertyKeywordBeforeIdentifier(identifierPosition: SemanticEditorPosition): SemanticEditorPosition? { + if (!identifierPosition.isAt(Identifier)) return null + return with(identifierPosition.copy()) { + if (!moveBeforeTypeQualifierIfPossible(false)) return null + // `val List.prop` + moveBeforeTypeParametersIfPossible() + takeIf { it.isVarOrVal() } + } + } + /** * @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)) + private fun findFunctionKeywordBeforeIdentifier(identifierPosition: SemanticEditorPosition): SemanticEditorPosition? { + // anonymous function `val a = fun() { }` + if (identifierPosition.isAt(FunctionKeyword)) return identifierPosition - moveBeforeIgnoringWhiteSpaceOrComment() - - // anonymous function `val a = fun() { }` - if (isAt(FunctionKeyword)) return this + return with(identifierPosition.copy()) { moveBeforeWhileThisIsWhiteSpaceOrComment() // anonymous function with receiver `val a = fun String.Companion????.() { }` if (isAt(Dot)) { moveBeforeIgnoringWhiteSpaceOrComment() - if (!moveBeforeTypeQualifierIfPossible()) return null + if (!moveBeforeTypeQualifierIfPossible(true)) return null return if (isAt(FunctionKeyword)) this else null } // name of declaration if (!isAt(Identifier)) return null - if (!moveBeforeTypeQualifierIfPossible()) return null + if (!moveBeforeTypeQualifierIfPossible(false)) return null moveBeforeTypeParametersIfPossible() takeIf { it.isAt(FunctionKeyword) } } + } private fun isSimilarToFunctionInvocation(leftParenthesis: SemanticEditorPosition): Boolean = with(leftParenthesis.copy()) { assert(isAt(LeftParenthesis)) @@ -210,9 +264,7 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider moveBeforeIgnoringWhiteSpaceOrComment() // val (a, b) = 1 to 2 - if (isAt(KtTokens.VAR_KEYWORD) || isAt(KtTokens.VAL_KEYWORD)) { - return true - } + if (isVarOrVal()) return true // in lambda like `val a = { i: Int -> println(i) }` if (!rightParenthesis.moveBeforeParametersIfPossible()) return false @@ -242,7 +294,7 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider // ^ if (isAt(RightParenthesis)) return moveBeforeParenthesesIfPossible() - if (!moveBeforeTypeQualifierIfPossible()) return false + if (!moveBeforeTypeQualifierIfPossible(true)) return false // optional colon // { a: Int -> @@ -273,7 +325,9 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider * * @receiver position of identifier */ - private fun SemanticEditorPosition.moveBeforeTypeQualifierIfPossible(): Boolean { + private fun SemanticEditorPosition.moveBeforeTypeQualifierIfPossible(canStartWithTypeParameter: Boolean): Boolean { + if (!canStartWithTypeParameter && !isAt(Identifier)) return false + while (!isAtEnd) { moveBeforeOptionalMix(Quest, *WHITE_SPACE_OR_COMMENT_BIT_SET) moveBeforeTypeParametersIfPossible() @@ -363,6 +417,8 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider } } + private fun SemanticEditorPosition.isVarOrVal(): Boolean = isAtAnyOf(Var, Val) + private fun SemanticEditorPosition.moveBeforeBlockIfPossible(): Boolean = moveBeforeParenthesesIfPossible( leftParenthesis = BlockOpeningBrace, rightParenthesis = BlockClosingBrace, @@ -410,6 +466,10 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider FunctionKeyword, Dot, Quest, + + Eq, + + Val, Var, } companion object { @@ -443,6 +503,11 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider KtTokens.QUEST to Quest, KtTokens.COMMA to Comma, KtTokens.COLON to Colon, + + KtTokens.EQ to Eq, + + KtTokens.VAL_KEYWORD to Val, + KtTokens.VAR_KEYWORD to Var, ) private val CONTROL_FLOW_KEYWORDS: HashSet = hashSetOf( 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 4f057a1695a..be5b2cd45af 100644 --- a/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/PerformanceTypingIndentationTestGenerated.java +++ b/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/PerformanceTypingIndentationTestGenerated.java @@ -88,11 +88,6 @@ public class PerformanceTypingIndentationTestGenerated extends AbstractPerforman runTest("idea/testData/indentationOnNewline/FunctionBlock.kt"); } - @TestMetadata("FunctionWithInference.kt") - public void testFunctionWithInference() throws Exception { - runTest("idea/testData/indentationOnNewline/FunctionWithInference.kt"); - } - @TestMetadata("InDelegationListAfterColon.kt") public void testInDelegationListAfterColon() throws Exception { runTest("idea/testData/indentationOnNewline/InDelegationListAfterColon.kt"); @@ -178,26 +173,11 @@ public class PerformanceTypingIndentationTestGenerated extends AbstractPerforman runTest("idea/testData/indentationOnNewline/ModifierListInUnfinishedDeclaration.kt"); } - @TestMetadata("MultideclarationAfterEq.kt") - public void testMultideclarationAfterEq() throws Exception { - runTest("idea/testData/indentationOnNewline/MultideclarationAfterEq.kt"); - } - - @TestMetadata("MultideclarationBeforeEq.kt") - public void testMultideclarationBeforeEq() throws Exception { - runTest("idea/testData/indentationOnNewline/MultideclarationBeforeEq.kt"); - } - @TestMetadata("NotFirstParameter.kt") public void testNotFirstParameter() throws Exception { runTest("idea/testData/indentationOnNewline/NotFirstParameter.kt"); } - @TestMetadata("PropertyWithInference.kt") - public void testPropertyWithInference() throws Exception { - runTest("idea/testData/indentationOnNewline/PropertyWithInference.kt"); - } - @TestMetadata("ReturnContinue.kt") public void testReturnContinue() throws Exception { runTest("idea/testData/indentationOnNewline/ReturnContinue.kt"); @@ -865,6 +845,109 @@ public class PerformanceTypingIndentationTestGenerated extends AbstractPerforman } } + @TestMetadata("idea/testData/indentationOnNewline/expressionBody") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ExpressionBody extends AbstractPerformanceTypingIndentationTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doPerfTest, this, testDataFilePath); + } + + @TestMetadata("AfterFunctionWithExplicitType.kt") + public void testAfterFunctionWithExplicitType() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithExplicitType.kt"); + } + + @TestMetadata("AfterFunctionWithInference.kt") + public void testAfterFunctionWithInference() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithInference.kt"); + } + + @TestMetadata("AfterFunctionWithTypeParameter.kt") + public void testAfterFunctionWithTypeParameter() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithTypeParameter.kt"); + } + + @TestMetadata("AfterMultideclaration.kt") + public void testAfterMultideclaration() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterMultideclaration.kt"); + } + + @TestMetadata("AfterMutableProperty.kt") + public void testAfterMutableProperty() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterMutableProperty.kt"); + } + + @TestMetadata("AfterPropertyWithExplicitType.kt") + public void testAfterPropertyWithExplicitType() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithExplicitType.kt"); + } + + @TestMetadata("AfterPropertyWithInference.kt") + public void testAfterPropertyWithInference() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithInference.kt"); + } + + @TestMetadata("AfterPropertyWithReceiver.kt") + public void testAfterPropertyWithReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithReceiver.kt"); + } + + @TestMetadata("AfterPropertyWithTypeParameterReceiver.kt") + public void testAfterPropertyWithTypeParameterReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithTypeParameterReceiver.kt"); + } + + public void testAllFilesPresentInExpressionBody() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/indentationOnNewline/expressionBody"), Pattern.compile("^([^.]+)\\.(kt|kts)$"), null, true); + } + + @TestMetadata("FunctionWithExplicitType.kt") + public void testFunctionWithExplicitType() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/FunctionWithExplicitType.kt"); + } + + @TestMetadata("FunctionWithInference.kt") + public void testFunctionWithInference() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/FunctionWithInference.kt"); + } + + @TestMetadata("FunctionWithTypeParameter.kt") + public void testFunctionWithTypeParameter() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/FunctionWithTypeParameter.kt"); + } + + @TestMetadata("Multideclaration.kt") + public void testMultideclaration() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/Multideclaration.kt"); + } + + @TestMetadata("MutableProperty.kt") + public void testMutableProperty() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/MutableProperty.kt"); + } + + @TestMetadata("PropertyWithExplicitType.kt") + public void testPropertyWithExplicitType() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/PropertyWithExplicitType.kt"); + } + + @TestMetadata("PropertyWithInference.kt") + public void testPropertyWithInference() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/PropertyWithInference.kt"); + } + + @TestMetadata("PropertyWithReceiver.kt") + public void testPropertyWithReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/PropertyWithReceiver.kt"); + } + + @TestMetadata("PropertyWithTypeParameterReceiver.kt") + public void testPropertyWithTypeParameterReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/PropertyWithTypeParameterReceiver.kt"); + } + } + @TestMetadata("idea/testData/indentationOnNewline/script") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/idea/src/org/jetbrains/kotlin/idea/formatter/KotlinLineIndentProvider.kt b/idea/src/org/jetbrains/kotlin/idea/formatter/KotlinLineIndentProvider.kt index 5f52e499332..00ac05aa597 100644 --- a/idea/src/org/jetbrains/kotlin/idea/formatter/KotlinLineIndentProvider.kt +++ b/idea/src/org/jetbrains/kotlin/idea/formatter/KotlinLineIndentProvider.kt @@ -31,6 +31,9 @@ class KotlinLineIndentProvider : KotlinLikeLangLineIndentProvider() { override val continuationIndentInElvis: Boolean get() = settings.kotlinCustomSettings.CONTINUATION_INDENT_IN_ELVIS + + override val continuationIndentForExpressionBodies: Boolean + get() = settings.kotlinCustomSettings.CONTINUATION_INDENT_FOR_EXPRESSION_BODIES } companion object { diff --git a/idea/testData/indentationOnNewline/FunctionWithInference.after.kt b/idea/testData/indentationOnNewline/FunctionWithInference.after.kt deleted file mode 100644 index e05aff571e0..00000000000 --- a/idea/testData/indentationOnNewline/FunctionWithInference.after.kt +++ /dev/null @@ -1,4 +0,0 @@ -fun test() = - - -// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/FunctionWithInference.kt b/idea/testData/indentationOnNewline/FunctionWithInference.kt deleted file mode 100644 index cf3cc2a2955..00000000000 --- a/idea/testData/indentationOnNewline/FunctionWithInference.kt +++ /dev/null @@ -1,3 +0,0 @@ -fun test() = - -// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/MultideclarationAfterEq.after.kt b/idea/testData/indentationOnNewline/MultideclarationAfterEq.after.kt deleted file mode 100644 index d68c0f1cf68..00000000000 --- a/idea/testData/indentationOnNewline/MultideclarationAfterEq.after.kt +++ /dev/null @@ -1,6 +0,0 @@ -fun test() { - val (a, b) = - -} - -// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/MultideclarationAfterEq.kt b/idea/testData/indentationOnNewline/MultideclarationAfterEq.kt deleted file mode 100644 index e807cecc5db..00000000000 --- a/idea/testData/indentationOnNewline/MultideclarationAfterEq.kt +++ /dev/null @@ -1,5 +0,0 @@ -fun test() { - val (a, b) = -} - -// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/MultideclarationBeforeEq.after.kt b/idea/testData/indentationOnNewline/MultideclarationBeforeEq.after.kt deleted file mode 100644 index 12176431e56..00000000000 --- a/idea/testData/indentationOnNewline/MultideclarationBeforeEq.after.kt +++ /dev/null @@ -1,6 +0,0 @@ -fun test() { - val (a, b) - -} - -// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/MultideclarationBeforeEq.kt b/idea/testData/indentationOnNewline/MultideclarationBeforeEq.kt deleted file mode 100644 index 053edcc8664..00000000000 --- a/idea/testData/indentationOnNewline/MultideclarationBeforeEq.kt +++ /dev/null @@ -1,5 +0,0 @@ -fun test() { - val (a, b) -} - -// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/PropertyWithInference.after.kt b/idea/testData/indentationOnNewline/PropertyWithInference.after.kt deleted file mode 100644 index b75f59e985a..00000000000 --- a/idea/testData/indentationOnNewline/PropertyWithInference.after.kt +++ /dev/null @@ -1,4 +0,0 @@ -val a = - - -// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/PropertyWithInference.kt b/idea/testData/indentationOnNewline/PropertyWithInference.kt deleted file mode 100644 index bbbd4fb3fe8..00000000000 --- a/idea/testData/indentationOnNewline/PropertyWithInference.kt +++ /dev/null @@ -1,3 +0,0 @@ -val a = - -// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithExplicitType.after.inv.kt b/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithExplicitType.after.inv.kt new file mode 100644 index 00000000000..722ee5d7882 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithExplicitType.after.inv.kt @@ -0,0 +1,4 @@ +fun List?.test(): String + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithExplicitType.after.kt b/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithExplicitType.after.kt new file mode 100644 index 00000000000..722ee5d7882 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithExplicitType.after.kt @@ -0,0 +1,4 @@ +fun List?.test(): String + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithExplicitType.kt b/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithExplicitType.kt new file mode 100644 index 00000000000..de2390e1731 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithExplicitType.kt @@ -0,0 +1,3 @@ +fun List?.test(): String + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithInference.after.inv.kt b/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithInference.after.inv.kt new file mode 100644 index 00000000000..14a7fa3a2f1 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithInference.after.inv.kt @@ -0,0 +1,4 @@ +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES + +fun test() + \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithInference.after.kt b/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithInference.after.kt new file mode 100644 index 00000000000..14a7fa3a2f1 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithInference.after.kt @@ -0,0 +1,4 @@ +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES + +fun test() + \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithInference.kt b/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithInference.kt new file mode 100644 index 00000000000..f5f195db3f9 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithInference.kt @@ -0,0 +1,3 @@ +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES + +fun test() \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithTypeParameter.after.inv.kt b/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithTypeParameter.after.inv.kt new file mode 100644 index 00000000000..155cf419320 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithTypeParameter.after.inv.kt @@ -0,0 +1,3 @@ +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES +fun test(t: T): String + \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithTypeParameter.after.kt b/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithTypeParameter.after.kt new file mode 100644 index 00000000000..155cf419320 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithTypeParameter.after.kt @@ -0,0 +1,3 @@ +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES +fun test(t: T): String + \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithTypeParameter.kt b/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithTypeParameter.kt new file mode 100644 index 00000000000..f74505a2beb --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithTypeParameter.kt @@ -0,0 +1,2 @@ +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES +fun test(t: T): String \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterMultideclaration.after.inv.kt b/idea/testData/indentationOnNewline/expressionBody/AfterMultideclaration.after.inv.kt new file mode 100644 index 00000000000..7941b07db0f --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterMultideclaration.after.inv.kt @@ -0,0 +1,6 @@ +fun test() { + val (a, b) + +} + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterMultideclaration.after.kt b/idea/testData/indentationOnNewline/expressionBody/AfterMultideclaration.after.kt new file mode 100644 index 00000000000..7941b07db0f --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterMultideclaration.after.kt @@ -0,0 +1,6 @@ +fun test() { + val (a, b) + +} + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterMultideclaration.kt b/idea/testData/indentationOnNewline/expressionBody/AfterMultideclaration.kt new file mode 100644 index 00000000000..20a107d9b95 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterMultideclaration.kt @@ -0,0 +1,5 @@ +fun test() { + val (a, b) +} + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterMutableProperty.after.inv.kt b/idea/testData/indentationOnNewline/expressionBody/AfterMutableProperty.after.inv.kt new file mode 100644 index 00000000000..131e691325d --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterMutableProperty.after.inv.kt @@ -0,0 +1,5 @@ +fun a() { + var b + +} +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterMutableProperty.after.kt b/idea/testData/indentationOnNewline/expressionBody/AfterMutableProperty.after.kt new file mode 100644 index 00000000000..131e691325d --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterMutableProperty.after.kt @@ -0,0 +1,5 @@ +fun a() { + var b + +} +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterMutableProperty.kt b/idea/testData/indentationOnNewline/expressionBody/AfterMutableProperty.kt new file mode 100644 index 00000000000..67bc80e0de5 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterMutableProperty.kt @@ -0,0 +1,4 @@ +fun a() { + var b +} +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithExplicitType.after.inv.kt b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithExplicitType.after.inv.kt new file mode 100644 index 00000000000..4fcdfda21f8 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithExplicitType.after.inv.kt @@ -0,0 +1,4 @@ +val a: String + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithExplicitType.after.kt b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithExplicitType.after.kt new file mode 100644 index 00000000000..4fcdfda21f8 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithExplicitType.after.kt @@ -0,0 +1,4 @@ +val a: String + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithExplicitType.kt b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithExplicitType.kt new file mode 100644 index 00000000000..64869becce7 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithExplicitType.kt @@ -0,0 +1,3 @@ +val a: String + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithInference.after.inv.kt b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithInference.after.inv.kt new file mode 100644 index 00000000000..39753a06cb0 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithInference.after.inv.kt @@ -0,0 +1,4 @@ +val a + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithInference.after.kt b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithInference.after.kt new file mode 100644 index 00000000000..39753a06cb0 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithInference.after.kt @@ -0,0 +1,4 @@ +val a + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithInference.kt b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithInference.kt new file mode 100644 index 00000000000..f763d017f9d --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithInference.kt @@ -0,0 +1,3 @@ +val a + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithReceiver.after.inv.kt b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithReceiver.after.inv.kt new file mode 100644 index 00000000000..70adbf65325 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithReceiver.after.inv.kt @@ -0,0 +1,4 @@ +val List.a: String + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithReceiver.after.kt b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithReceiver.after.kt new file mode 100644 index 00000000000..70adbf65325 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithReceiver.after.kt @@ -0,0 +1,4 @@ +val List.a: String + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithReceiver.kt b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithReceiver.kt new file mode 100644 index 00000000000..b9abe347b25 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithReceiver.kt @@ -0,0 +1,3 @@ +val List.a: String + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithTypeParameterReceiver.after.inv.kt b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithTypeParameterReceiver.after.inv.kt new file mode 100644 index 00000000000..bbab6be45a8 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithTypeParameterReceiver.after.inv.kt @@ -0,0 +1,4 @@ +val List.a: String + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithTypeParameterReceiver.after.kt b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithTypeParameterReceiver.after.kt new file mode 100644 index 00000000000..bbab6be45a8 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithTypeParameterReceiver.after.kt @@ -0,0 +1,4 @@ +val List.a: String + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithTypeParameterReceiver.kt b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithTypeParameterReceiver.kt new file mode 100644 index 00000000000..e8dad9bdf84 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithTypeParameterReceiver.kt @@ -0,0 +1,3 @@ +val List.a: String + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/FunctionWithExplicitType.after.inv.kt b/idea/testData/indentationOnNewline/expressionBody/FunctionWithExplicitType.after.inv.kt new file mode 100644 index 00000000000..a914bedeb5e --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/FunctionWithExplicitType.after.inv.kt @@ -0,0 +1,4 @@ +fun List?.test(): String = + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/FunctionWithExplicitType.after.kt b/idea/testData/indentationOnNewline/expressionBody/FunctionWithExplicitType.after.kt new file mode 100644 index 00000000000..a4b47a108a1 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/FunctionWithExplicitType.after.kt @@ -0,0 +1,4 @@ +fun List?.test(): String = + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/FunctionWithExplicitType.kt b/idea/testData/indentationOnNewline/expressionBody/FunctionWithExplicitType.kt new file mode 100644 index 00000000000..7c1fafeacda --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/FunctionWithExplicitType.kt @@ -0,0 +1,3 @@ +fun List?.test(): String = + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/FunctionWithInference.after.inv.kt b/idea/testData/indentationOnNewline/expressionBody/FunctionWithInference.after.inv.kt new file mode 100644 index 00000000000..3cb87180635 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/FunctionWithInference.after.inv.kt @@ -0,0 +1,4 @@ +fun test() = + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/FunctionWithInference.after.kt b/idea/testData/indentationOnNewline/expressionBody/FunctionWithInference.after.kt new file mode 100644 index 00000000000..190fa31a9ba --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/FunctionWithInference.after.kt @@ -0,0 +1,4 @@ +fun test() = + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/FunctionWithInference.kt b/idea/testData/indentationOnNewline/expressionBody/FunctionWithInference.kt new file mode 100644 index 00000000000..12780827d58 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/FunctionWithInference.kt @@ -0,0 +1,3 @@ +fun test() = + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/FunctionWithTypeParameter.after.inv.kt b/idea/testData/indentationOnNewline/expressionBody/FunctionWithTypeParameter.after.inv.kt new file mode 100644 index 00000000000..818545fdcc4 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/FunctionWithTypeParameter.after.inv.kt @@ -0,0 +1,4 @@ +fun test(t: T): String = + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/FunctionWithTypeParameter.after.kt b/idea/testData/indentationOnNewline/expressionBody/FunctionWithTypeParameter.after.kt new file mode 100644 index 00000000000..c477c2ade08 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/FunctionWithTypeParameter.after.kt @@ -0,0 +1,4 @@ +fun test(t: T): String = + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/FunctionWithTypeParameter.kt b/idea/testData/indentationOnNewline/expressionBody/FunctionWithTypeParameter.kt new file mode 100644 index 00000000000..39110710fa6 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/FunctionWithTypeParameter.kt @@ -0,0 +1,3 @@ +fun test(t: T): String = + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/Multideclaration.after.inv.kt b/idea/testData/indentationOnNewline/expressionBody/Multideclaration.after.inv.kt new file mode 100644 index 00000000000..7774988fd8c --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/Multideclaration.after.inv.kt @@ -0,0 +1,6 @@ +fun test() { + val (a, b) = + +} + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/Multideclaration.after.kt b/idea/testData/indentationOnNewline/expressionBody/Multideclaration.after.kt new file mode 100644 index 00000000000..a0aea8df014 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/Multideclaration.after.kt @@ -0,0 +1,6 @@ +fun test() { + val (a, b) = + +} + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/Multideclaration.kt b/idea/testData/indentationOnNewline/expressionBody/Multideclaration.kt new file mode 100644 index 00000000000..8ea301510b3 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/Multideclaration.kt @@ -0,0 +1,5 @@ +fun test() { + val (a, b) = +} + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/MutableProperty.after.inv.kt b/idea/testData/indentationOnNewline/expressionBody/MutableProperty.after.inv.kt new file mode 100644 index 00000000000..47aa9a893a4 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/MutableProperty.after.inv.kt @@ -0,0 +1,5 @@ +fun a() { + var b = + +} +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/MutableProperty.after.kt b/idea/testData/indentationOnNewline/expressionBody/MutableProperty.after.kt new file mode 100644 index 00000000000..153e030ae60 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/MutableProperty.after.kt @@ -0,0 +1,5 @@ +fun a() { + var b = + +} +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/MutableProperty.kt b/idea/testData/indentationOnNewline/expressionBody/MutableProperty.kt new file mode 100644 index 00000000000..5bcd6b40d52 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/MutableProperty.kt @@ -0,0 +1,4 @@ +fun a() { + var b = +} +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/PropertyWithExplicitType.after.inv.kt b/idea/testData/indentationOnNewline/expressionBody/PropertyWithExplicitType.after.inv.kt new file mode 100644 index 00000000000..94f48a7d7e0 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/PropertyWithExplicitType.after.inv.kt @@ -0,0 +1,4 @@ +val a: String = + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/PropertyWithExplicitType.after.kt b/idea/testData/indentationOnNewline/expressionBody/PropertyWithExplicitType.after.kt new file mode 100644 index 00000000000..00c66588530 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/PropertyWithExplicitType.after.kt @@ -0,0 +1,4 @@ +val a: String = + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/PropertyWithExplicitType.kt b/idea/testData/indentationOnNewline/expressionBody/PropertyWithExplicitType.kt new file mode 100644 index 00000000000..1144a185be3 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/PropertyWithExplicitType.kt @@ -0,0 +1,3 @@ +val a: String = + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/PropertyWithInference.after.inv.kt b/idea/testData/indentationOnNewline/expressionBody/PropertyWithInference.after.inv.kt new file mode 100644 index 00000000000..09874955179 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/PropertyWithInference.after.inv.kt @@ -0,0 +1,4 @@ +val a = + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/PropertyWithInference.after.kt b/idea/testData/indentationOnNewline/expressionBody/PropertyWithInference.after.kt new file mode 100644 index 00000000000..64bdbac11fc --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/PropertyWithInference.after.kt @@ -0,0 +1,4 @@ +val a = + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/PropertyWithInference.kt b/idea/testData/indentationOnNewline/expressionBody/PropertyWithInference.kt new file mode 100644 index 00000000000..f32f1ced1f7 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/PropertyWithInference.kt @@ -0,0 +1,3 @@ +val a = + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/PropertyWithReceiver.after.inv.kt b/idea/testData/indentationOnNewline/expressionBody/PropertyWithReceiver.after.inv.kt new file mode 100644 index 00000000000..d63ca73329c --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/PropertyWithReceiver.after.inv.kt @@ -0,0 +1,4 @@ +val List.a: String = + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/PropertyWithReceiver.after.kt b/idea/testData/indentationOnNewline/expressionBody/PropertyWithReceiver.after.kt new file mode 100644 index 00000000000..e2270e2862a --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/PropertyWithReceiver.after.kt @@ -0,0 +1,4 @@ +val List.a: String = + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/PropertyWithReceiver.kt b/idea/testData/indentationOnNewline/expressionBody/PropertyWithReceiver.kt new file mode 100644 index 00000000000..8ebcb766385 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/PropertyWithReceiver.kt @@ -0,0 +1,3 @@ +val List.a: String = + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/PropertyWithTypeParameterReceiver.after.inv.kt b/idea/testData/indentationOnNewline/expressionBody/PropertyWithTypeParameterReceiver.after.inv.kt new file mode 100644 index 00000000000..f219d7cc722 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/PropertyWithTypeParameterReceiver.after.inv.kt @@ -0,0 +1,4 @@ +val List.a: String = + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/PropertyWithTypeParameterReceiver.after.kt b/idea/testData/indentationOnNewline/expressionBody/PropertyWithTypeParameterReceiver.after.kt new file mode 100644 index 00000000000..a19ea5de29a --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/PropertyWithTypeParameterReceiver.after.kt @@ -0,0 +1,4 @@ +val List.a: String = + + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ No newline at end of file diff --git a/idea/testData/indentationOnNewline/expressionBody/PropertyWithTypeParameterReceiver.kt b/idea/testData/indentationOnNewline/expressionBody/PropertyWithTypeParameterReceiver.kt new file mode 100644 index 00000000000..d439609cf86 --- /dev/null +++ b/idea/testData/indentationOnNewline/expressionBody/PropertyWithTypeParameterReceiver.kt @@ -0,0 +1,3 @@ +val List.a: String = + +// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES \ 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 e3caf597aae..d63641c5a74 100644 --- a/idea/tests/org/jetbrains/kotlin/formatter/TypingIndentationTestBaseGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/formatter/TypingIndentationTestBaseGenerated.java @@ -90,11 +90,6 @@ public class TypingIndentationTestBaseGenerated extends AbstractTypingIndentatio runTest("idea/testData/indentationOnNewline/FunctionBlock.after.kt"); } - @TestMetadata("FunctionWithInference.after.kt") - public void testFunctionWithInference() throws Exception { - runTest("idea/testData/indentationOnNewline/FunctionWithInference.after.kt"); - } - @TestMetadata("InDelegationListAfterColon.after.kt") public void testInDelegationListAfterColon() throws Exception { runTest("idea/testData/indentationOnNewline/InDelegationListAfterColon.after.kt"); @@ -180,26 +175,11 @@ public class TypingIndentationTestBaseGenerated extends AbstractTypingIndentatio runTest("idea/testData/indentationOnNewline/ModifierListInUnfinishedDeclaration.after.kt"); } - @TestMetadata("MultideclarationAfterEq.after.kt") - public void testMultideclarationAfterEq() throws Exception { - runTest("idea/testData/indentationOnNewline/MultideclarationAfterEq.after.kt"); - } - - @TestMetadata("MultideclarationBeforeEq.after.kt") - public void testMultideclarationBeforeEq() throws Exception { - runTest("idea/testData/indentationOnNewline/MultideclarationBeforeEq.after.kt"); - } - @TestMetadata("NotFirstParameter.after.kt") public void testNotFirstParameter() throws Exception { runTest("idea/testData/indentationOnNewline/NotFirstParameter.after.kt"); } - @TestMetadata("PropertyWithInference.after.kt") - public void testPropertyWithInference() throws Exception { - runTest("idea/testData/indentationOnNewline/PropertyWithInference.after.kt"); - } - @TestMetadata("ReturnContinue.after.kt") public void testReturnContinue() throws Exception { runTest("idea/testData/indentationOnNewline/ReturnContinue.after.kt"); @@ -862,6 +842,109 @@ public class TypingIndentationTestBaseGenerated extends AbstractTypingIndentatio } } + @TestMetadata("idea/testData/indentationOnNewline/expressionBody") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ExpressionBody extends AbstractTypingIndentationTestBase { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doNewlineTest, this, testDataFilePath); + } + + @TestMetadata("AfterFunctionWithExplicitType.after.kt") + public void testAfterFunctionWithExplicitType() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithExplicitType.after.kt"); + } + + @TestMetadata("AfterFunctionWithInference.after.kt") + public void testAfterFunctionWithInference() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithInference.after.kt"); + } + + @TestMetadata("AfterFunctionWithTypeParameter.after.kt") + public void testAfterFunctionWithTypeParameter() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithTypeParameter.after.kt"); + } + + @TestMetadata("AfterMultideclaration.after.kt") + public void testAfterMultideclaration() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterMultideclaration.after.kt"); + } + + @TestMetadata("AfterMutableProperty.after.kt") + public void testAfterMutableProperty() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterMutableProperty.after.kt"); + } + + @TestMetadata("AfterPropertyWithExplicitType.after.kt") + public void testAfterPropertyWithExplicitType() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithExplicitType.after.kt"); + } + + @TestMetadata("AfterPropertyWithInference.after.kt") + public void testAfterPropertyWithInference() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithInference.after.kt"); + } + + @TestMetadata("AfterPropertyWithReceiver.after.kt") + public void testAfterPropertyWithReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithReceiver.after.kt"); + } + + @TestMetadata("AfterPropertyWithTypeParameterReceiver.after.kt") + public void testAfterPropertyWithTypeParameterReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithTypeParameterReceiver.after.kt"); + } + + public void testAllFilesPresentInExpressionBody() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/indentationOnNewline/expressionBody"), Pattern.compile("^([^\\.]+)\\.after\\.kt.*$"), null, true); + } + + @TestMetadata("FunctionWithExplicitType.after.kt") + public void testFunctionWithExplicitType() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/FunctionWithExplicitType.after.kt"); + } + + @TestMetadata("FunctionWithInference.after.kt") + public void testFunctionWithInference() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/FunctionWithInference.after.kt"); + } + + @TestMetadata("FunctionWithTypeParameter.after.kt") + public void testFunctionWithTypeParameter() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/FunctionWithTypeParameter.after.kt"); + } + + @TestMetadata("Multideclaration.after.kt") + public void testMultideclaration() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/Multideclaration.after.kt"); + } + + @TestMetadata("MutableProperty.after.kt") + public void testMutableProperty() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/MutableProperty.after.kt"); + } + + @TestMetadata("PropertyWithExplicitType.after.kt") + public void testPropertyWithExplicitType() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/PropertyWithExplicitType.after.kt"); + } + + @TestMetadata("PropertyWithInference.after.kt") + public void testPropertyWithInference() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/PropertyWithInference.after.kt"); + } + + @TestMetadata("PropertyWithReceiver.after.kt") + public void testPropertyWithReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/PropertyWithReceiver.after.kt"); + } + + @TestMetadata("PropertyWithTypeParameterReceiver.after.kt") + public void testPropertyWithTypeParameterReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/PropertyWithTypeParameterReceiver.after.kt"); + } + } + @TestMetadata("idea/testData/indentationOnNewline/script") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -1243,6 +1326,109 @@ public class TypingIndentationTestBaseGenerated extends AbstractTypingIndentatio } } + @TestMetadata("idea/testData/indentationOnNewline/expressionBody") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ExpressionBody extends AbstractTypingIndentationTestBase { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doNewlineTestWithInvert, this, testDataFilePath); + } + + @TestMetadata("AfterFunctionWithExplicitType.after.inv.kt") + public void testAfterFunctionWithExplicitType() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithExplicitType.after.inv.kt"); + } + + @TestMetadata("AfterFunctionWithInference.after.inv.kt") + public void testAfterFunctionWithInference() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithInference.after.inv.kt"); + } + + @TestMetadata("AfterFunctionWithTypeParameter.after.inv.kt") + public void testAfterFunctionWithTypeParameter() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterFunctionWithTypeParameter.after.inv.kt"); + } + + @TestMetadata("AfterMultideclaration.after.inv.kt") + public void testAfterMultideclaration() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterMultideclaration.after.inv.kt"); + } + + @TestMetadata("AfterMutableProperty.after.inv.kt") + public void testAfterMutableProperty() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterMutableProperty.after.inv.kt"); + } + + @TestMetadata("AfterPropertyWithExplicitType.after.inv.kt") + public void testAfterPropertyWithExplicitType() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithExplicitType.after.inv.kt"); + } + + @TestMetadata("AfterPropertyWithInference.after.inv.kt") + public void testAfterPropertyWithInference() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithInference.after.inv.kt"); + } + + @TestMetadata("AfterPropertyWithReceiver.after.inv.kt") + public void testAfterPropertyWithReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithReceiver.after.inv.kt"); + } + + @TestMetadata("AfterPropertyWithTypeParameterReceiver.after.inv.kt") + public void testAfterPropertyWithTypeParameterReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/AfterPropertyWithTypeParameterReceiver.after.inv.kt"); + } + + public void testAllFilesPresentInExpressionBody() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/indentationOnNewline/expressionBody"), Pattern.compile("^([^\\.]+)\\.after\\.inv\\.kt.*$"), null, true); + } + + @TestMetadata("FunctionWithExplicitType.after.inv.kt") + public void testFunctionWithExplicitType() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/FunctionWithExplicitType.after.inv.kt"); + } + + @TestMetadata("FunctionWithInference.after.inv.kt") + public void testFunctionWithInference() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/FunctionWithInference.after.inv.kt"); + } + + @TestMetadata("FunctionWithTypeParameter.after.inv.kt") + public void testFunctionWithTypeParameter() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/FunctionWithTypeParameter.after.inv.kt"); + } + + @TestMetadata("Multideclaration.after.inv.kt") + public void testMultideclaration() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/Multideclaration.after.inv.kt"); + } + + @TestMetadata("MutableProperty.after.inv.kt") + public void testMutableProperty() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/MutableProperty.after.inv.kt"); + } + + @TestMetadata("PropertyWithExplicitType.after.inv.kt") + public void testPropertyWithExplicitType() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/PropertyWithExplicitType.after.inv.kt"); + } + + @TestMetadata("PropertyWithInference.after.inv.kt") + public void testPropertyWithInference() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/PropertyWithInference.after.inv.kt"); + } + + @TestMetadata("PropertyWithReceiver.after.inv.kt") + public void testPropertyWithReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/PropertyWithReceiver.after.inv.kt"); + } + + @TestMetadata("PropertyWithTypeParameterReceiver.after.inv.kt") + public void testPropertyWithTypeParameterReceiver() throws Exception { + runTest("idea/testData/indentationOnNewline/expressionBody/PropertyWithTypeParameterReceiver.after.inv.kt"); + } + } + @TestMetadata("idea/testData/indentationOnNewline/script") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)