Option to use normal indent in chained calls

#KT-18605 Fixed
This commit is contained in:
Dmitry Jemerov
2017-06-22 14:30:24 +02:00
parent d8bb0b1023
commit 8fe2858c6a
14 changed files with 122 additions and 2 deletions
@@ -0,0 +1,12 @@
class Some {
fun some(): Some? = this
}
public fun bar(): String? =
Some()
?.some()
?.some()
?.some()!!
.toString()
// SET_TRUE: CONTINUATION_INDENT_FOR_CHAINED_CALLS
@@ -9,3 +9,4 @@ public fun bar(): String? =
?.some()!!
.toString()
// SET_TRUE: CONTINUATION_INDENT_FOR_CHAINED_CALLS
+1
View File
@@ -9,3 +9,4 @@ Some()
?.some()!!
.toString()
// SET_TRUE: CONTINUATION_INDENT_FOR_CHAINED_CALLS
@@ -0,0 +1,4 @@
val x = "abc"
.length
// SET_TRUE: CONTINUATION_INDENT_FOR_CHAINED_CALLS
@@ -0,0 +1,4 @@
val x = "abc"
.length
// SET_TRUE: CONTINUATION_INDENT_FOR_CHAINED_CALLS
@@ -0,0 +1,4 @@
val x = "abc"
.length
// SET_TRUE: CONTINUATION_INDENT_FOR_CHAINED_CALLS
@@ -0,0 +1,46 @@
import java.util.ArrayList
fun test() {
val abc = ArrayList<Int>()
.map {
it * 2
}
.filter {
it > 4
}
}
fun test1() {
val abc = ArrayList<Int>()
.map({
it * 2
})
.filter({
it > 4
})
}
fun test2() {
val abc = ArrayList<Int>()
.map {
it * 2
}
}
fun test3() {
val abc = ArrayList<Int>().map {
it * 2
}
}
fun testWithComments() {
val abc = ArrayList<Int>()
// .map {
// it * 2
// }
.filter {
it > 4
}
}
// SET_TRUE: CONTINUATION_INDENT_FOR_CHAINED_CALLS
@@ -43,3 +43,4 @@ fun testWithComments() {
}
}
// SET_TRUE: CONTINUATION_INDENT_FOR_CHAINED_CALLS
@@ -42,3 +42,5 @@ fun testWithComments() {
it > 4
}
}
// SET_TRUE: CONTINUATION_INDENT_FOR_CHAINED_CALLS