Fix indent of expressions following elvis operator

This commit is contained in:
Dmitry Jemerov
2017-12-11 11:57:38 +01:00
parent 87d2d16cda
commit 900ec82614
7 changed files with 112 additions and 25 deletions
+14
View File
@@ -0,0 +1,14 @@
fun foo() {
val topLevelDeclaration =
DescriptorUtils.getParentOfType(referencedDescriptor, PropertyDescriptor::class.java, false) as DeclarationDescriptor?
?: DescriptorUtils.getParentOfType(
referencedDescriptor,
TypeAliasConstructorDescriptor::class.java,
false
)?.typeAliasDescriptor
?: DescriptorUtils.getParentOfType(referencedDescriptor, FunctionDescriptor::class.java, false)
?: return emptyList()
}
// SET_FALSE: CONTINUATION_INDENT_IN_ARGUMENT_LISTS
// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES
+14
View File
@@ -0,0 +1,14 @@
fun foo() {
val topLevelDeclaration =
DescriptorUtils.getParentOfType(referencedDescriptor, PropertyDescriptor::class.java, false) as DeclarationDescriptor?
?: DescriptorUtils.getParentOfType(
referencedDescriptor,
TypeAliasConstructorDescriptor::class.java,
false
)?.typeAliasDescriptor
?: DescriptorUtils.getParentOfType(referencedDescriptor, FunctionDescriptor::class.java, false)
?: return emptyList()
}
// SET_FALSE: CONTINUATION_INDENT_IN_ARGUMENT_LISTS
// SET_FALSE: CONTINUATION_INDENT_FOR_EXPRESSION_BODIES
@@ -33,6 +33,14 @@ fun test3() {
}
}
fun test4() {
val abc = ArrayList<Int>().mapTo(
LinkedHashSet()
) {
it * 2
}
}
fun testWithComments() {
val abc = ArrayList<Int>()
// .map {
@@ -33,6 +33,14 @@ fun test3() {
}
}
fun test4() {
val abc = ArrayList<Int>().mapTo(
LinkedHashSet()
) {
it * 2
}
}
fun testWithComments() {
val abc = ArrayList<Int>()
// .map {
@@ -33,6 +33,14 @@ val abc = ArrayList<Int>().map {
}
}
fun test4() {
val abc = ArrayList<Int>().mapTo(
LinkedHashSet()
) {
it * 2
}
}
fun testWithComments() {
val abc = ArrayList<Int>()
// .map {