LineIndentProvider: temporarily disable before elvis operator

#KT-39716 Fixed
This commit is contained in:
Dmitry Gridin
2020-06-23 15:16:44 +07:00
parent 793ada08a9
commit 9313073971
7 changed files with 21 additions and 14 deletions
@@ -66,14 +66,15 @@ abstract class KotlinLikeLangLineIndentProvider : JavaLikeLangLineIndentProvider
before.isAt(BlockOpeningBrace) && before.beforeIgnoringWhiteSpaceOrComment().isFunctionDeclaration() -> before.isAt(BlockOpeningBrace) && before.beforeIgnoringWhiteSpaceOrComment().isFunctionDeclaration() ->
return factory.createIndentCalculator(Indent.getNormalIndent(), before.startOffset) return factory.createIndentCalculator(Indent.getNormalIndent(), before.startOffset)
after.isAt(Quest) && after.after().isAt(Colon) -> { // KT-39716
val indent = if (settings.continuationIndentInElvis) // after.isAt(Quest) && after.after().isAt(Colon) -> {
Indent.getContinuationIndent() // val indent = if (settings.continuationIndentInElvis)
else // Indent.getContinuationIndent()
Indent.getNormalIndent() // else
// Indent.getNormalIndent()
return factory.createIndentCalculator(indent, before.startOffset) //
} // return factory.createIndentCalculator(indent, before.startOffset)
// }
before.isAt(Colon) && before.before().isAt(Quest) -> before.isAt(Colon) && before.before().isAt(Quest) ->
return factory.createIndentCalculator(Indent.getNoneIndent(), before.startOffset) return factory.createIndentCalculator(Indent.getNoneIndent(), before.startOffset)
@@ -4,3 +4,4 @@ fun test(some: Any?, error: Int) {
} }
// SET_FALSE: CONTINUATION_INDENT_IN_ELVIS // SET_FALSE: CONTINUATION_INDENT_IN_ELVIS
// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER
@@ -4,3 +4,4 @@ fun test(some: Any?, error: Int) {
} }
// SET_FALSE: CONTINUATION_INDENT_IN_ELVIS // SET_FALSE: CONTINUATION_INDENT_IN_ELVIS
// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER
@@ -3,3 +3,4 @@ fun test(some: Any?, error: Int) {
} }
// SET_FALSE: CONTINUATION_INDENT_IN_ELVIS // SET_FALSE: CONTINUATION_INDENT_IN_ELVIS
// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER
@@ -4,3 +4,4 @@ fun a() {
} }
// SET_FALSE: CONTINUATION_INDENT_IN_ELVIS // SET_FALSE: CONTINUATION_INDENT_IN_ELVIS
// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER
@@ -4,3 +4,4 @@ fun a() {
} }
// SET_FALSE: CONTINUATION_INDENT_IN_ELVIS // SET_FALSE: CONTINUATION_INDENT_IN_ELVIS
// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER
@@ -3,3 +3,4 @@ fun a() {
} }
// SET_FALSE: CONTINUATION_INDENT_IN_ELVIS // SET_FALSE: CONTINUATION_INDENT_IN_ELVIS
// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER