Extract Function: In case of top-level and member declarations place extracted function after the original container

This commit is contained in:
Alexey Sedunov
2014-05-30 14:37:41 +04:00
parent ae7ad6d61c
commit 3c5c0248a7
138 changed files with 482 additions and 440 deletions
@@ -1,4 +1,4 @@
// NEXT_SIBLING:
// SIBLING:
fun foo(a: Int): Int {
val b: Int = 1
return <selection>if (a + b > 0) 1 else if (a - b < 0) 2 else b </selection>
@@ -1,9 +1,9 @@
// NEXT_SIBLING:
fun i(a: Int, b: Int): Int {
return if (a + b > 0) 1 else if (a - b < 0) 2 else b
}
// SIBLING:
fun foo(a: Int): Int {
val b: Int = 1
return i(a, b)
}
fun i(a: Int, b: Int): Int {
return if (a + b > 0) 1 else if (a - b < 0) 2 else b
}
@@ -1,4 +1,4 @@
// NEXT_SIBLING:
// SIBLING:
fun foo(a: Int): Int {
val b: Int = 1
return <selection>when (a + b) {
@@ -1,13 +1,13 @@
// NEXT_SIBLING:
// SIBLING:
fun foo(a: Int): Int {
val b: Int = 1
return i(a, b)
}
fun i(a: Int, b: Int): Int {
return when (a + b) {
0 -> b
1 -> -b
else -> a - b
}
}
fun foo(a: Int): Int {
val b: Int = 1
return i(a, b)
}
@@ -1,4 +1,4 @@
// NEXT_SIBLING:
// SIBLING:
fun foo(a: Int): Int {
val b: Int = 1
return <selection>a + b</selection>
@@ -1,9 +1,9 @@
// NEXT_SIBLING:
fun i(a: Int, b: Int): Int {
return a + b
}
// SIBLING:
fun foo(a: Int): Int {
val b: Int = 1
return i(a, b)
}
fun i(a: Int, b: Int): Int {
return a + b
}