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() ->
return factory.createIndentCalculator(Indent.getNormalIndent(), before.startOffset)
after.isAt(Quest) && after.after().isAt(Colon) -> {
val indent = if (settings.continuationIndentInElvis)
Indent.getContinuationIndent()
else
Indent.getNormalIndent()
return factory.createIndentCalculator(indent, before.startOffset)
}
// KT-39716
// after.isAt(Quest) && after.after().isAt(Colon) -> {
// val indent = if (settings.continuationIndentInElvis)
// Indent.getContinuationIndent()
// else
// Indent.getNormalIndent()
//
// return factory.createIndentCalculator(indent, before.startOffset)
// }
before.isAt(Colon) && before.before().isAt(Quest) ->
return factory.createIndentCalculator(Indent.getNoneIndent(), before.startOffset)
@@ -3,4 +3,5 @@ fun test(some: Any?, error: Int) {
<caret>?: error
}
// SET_FALSE: CONTINUATION_INDENT_IN_ELVIS
// SET_FALSE: CONTINUATION_INDENT_IN_ELVIS
// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER
@@ -3,4 +3,5 @@ fun test(some: Any?, error: Int) {
<caret>?: error
}
// SET_FALSE: CONTINUATION_INDENT_IN_ELVIS
// SET_FALSE: CONTINUATION_INDENT_IN_ELVIS
// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER
+2 -1
View File
@@ -2,4 +2,5 @@ fun test(some: Any?, error: Int) {
val test = some <caret>?: error
}
// SET_FALSE: CONTINUATION_INDENT_IN_ELVIS
// SET_FALSE: CONTINUATION_INDENT_IN_ELVIS
// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER
@@ -3,4 +3,5 @@ fun a() {
<caret>?: 2)
}
// SET_FALSE: CONTINUATION_INDENT_IN_ELVIS
// SET_FALSE: CONTINUATION_INDENT_IN_ELVIS
// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER
@@ -3,4 +3,5 @@ fun a() {
<caret>?: 2)
}
// SET_FALSE: CONTINUATION_INDENT_IN_ELVIS
// SET_FALSE: CONTINUATION_INDENT_IN_ELVIS
// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER
@@ -2,4 +2,5 @@ fun a() {
println(1 + null <caret>?: 2)
}
// SET_FALSE: CONTINUATION_INDENT_IN_ELVIS
// SET_FALSE: CONTINUATION_INDENT_IN_ELVIS
// WITHOUT_CUSTOM_LINE_INDENT_PROVIDER