LineIndentProvider: temporarily disable before elvis operator
#KT-39716 Fixed
This commit is contained in:
+9
-8
@@ -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
@@ -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
|
||||
+2
-1
@@ -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
-1
@@ -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
|
||||
Reference in New Issue
Block a user