Surround with: move declaration out from block
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
fun foo() {
|
||||
<selection>val a = "aaa"
|
||||
val b = "aaa"</selection>
|
||||
|
||||
a.charAt(1)
|
||||
b.charAt(1)
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fun foo() {
|
||||
val a: String
|
||||
val b: String
|
||||
<selection>run</selection> {
|
||||
a = "aaa"
|
||||
b = "aaa"
|
||||
}
|
||||
|
||||
a.charAt(1)
|
||||
b.charAt(1)
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
fun foo() {
|
||||
<selection>class A {}
|
||||
"bbb"</selection>
|
||||
|
||||
val myClass: A? = null
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fun foo() {
|
||||
class A {}
|
||||
if (<caret>) {
|
||||
"bbb"
|
||||
}
|
||||
|
||||
val myClass: A? = null
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
fun foo() {
|
||||
<selection>class A {}
|
||||
"bbb"</selection>
|
||||
|
||||
val myClass = A()
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fun foo() {
|
||||
class A {}
|
||||
if (<caret>) {
|
||||
"bbb"
|
||||
}
|
||||
|
||||
val myClass = A()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
fun foo() {
|
||||
<selection>fun test() {}
|
||||
"aaa"</selection>
|
||||
test()
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fun foo() {
|
||||
fun test() {}
|
||||
if (<caret>) {
|
||||
"aaa"
|
||||
}
|
||||
test()
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun foo() {
|
||||
<selection>"aaa"
|
||||
fun test() {}
|
||||
"aaa"</selection>
|
||||
|
||||
test()
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fun foo() {
|
||||
fun test() {}
|
||||
if (<caret>) {
|
||||
"aaa"
|
||||
"aaa"
|
||||
}
|
||||
|
||||
test()
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fun foo() {
|
||||
<selection>
|
||||
fun test() {}
|
||||
"aaa"
|
||||
test()
|
||||
</selection>
|
||||
|
||||
val a = "ss"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fun foo() {
|
||||
|
||||
if (<caret>) {
|
||||
fun test() {}
|
||||
"aaa"
|
||||
test()
|
||||
}
|
||||
|
||||
|
||||
val a = "ss"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
fun foo() {
|
||||
<selection>object A {}
|
||||
"bbb"</selection>
|
||||
|
||||
val myClass = A
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fun foo() {
|
||||
object A {}
|
||||
if (<caret>) {
|
||||
"bbb"
|
||||
}
|
||||
|
||||
val myClass = A
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fun foo() {
|
||||
<selection>"start"
|
||||
open class A {}
|
||||
class B: A() {}
|
||||
"end"</selection>
|
||||
|
||||
val c = B()
|
||||
val d = A()
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fun foo() {
|
||||
open class A {}
|
||||
class B: A() {}
|
||||
if (<caret>) {
|
||||
"start"
|
||||
"end"
|
||||
}
|
||||
|
||||
val c = B()
|
||||
val d = A()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fun foo() {
|
||||
<selection>class A {
|
||||
fun test() {}
|
||||
}
|
||||
val d: A = A()</selection>
|
||||
|
||||
d.test()
|
||||
A()
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fun foo() {
|
||||
class A {
|
||||
fun test() {}
|
||||
}
|
||||
val d: A
|
||||
if (<caret>) {
|
||||
d = A()
|
||||
}
|
||||
|
||||
d.test()
|
||||
A()
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun foo() {
|
||||
<selection>val a: String = "aaa"
|
||||
val b = a</selection>
|
||||
|
||||
a.charAt(1)
|
||||
b.charAt(1)
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fun foo() {
|
||||
val a: String
|
||||
val b: String
|
||||
if (<caret>) {
|
||||
a = "aaa"
|
||||
b = a
|
||||
}
|
||||
|
||||
a.charAt(1)
|
||||
b.charAt(1)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
fun foo() {
|
||||
<caret>val a: kotlin.test.Asserter? = null
|
||||
|
||||
a?.charAt(1)
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fun foo() {
|
||||
val a: kotlin.test.Asserter?
|
||||
if (<caret>) {
|
||||
a = null
|
||||
}
|
||||
|
||||
a?.charAt(1)
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
class A {}
|
||||
|
||||
fun foo() {
|
||||
<caret>val a = test.A()
|
||||
|
||||
a.hashCode()
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
class A {}
|
||||
|
||||
fun foo() {
|
||||
val a: A
|
||||
if (<caret>) {
|
||||
a = test.A()
|
||||
}
|
||||
|
||||
a.hashCode()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
fun foo() {
|
||||
<caret>val a: String = "aaa"
|
||||
|
||||
a.charAt(1)
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fun foo() {
|
||||
val a: String
|
||||
if () {
|
||||
a = "aaa"
|
||||
}
|
||||
|
||||
a.charAt(1)
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fun foo() {
|
||||
<selection>val a: String
|
||||
a = "a"
|
||||
a.capitalize()
|
||||
val b: String
|
||||
b = "b"
|
||||
b.capitalize()</selection>
|
||||
|
||||
a.charAt(1)
|
||||
b.charAt(1)
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
fun foo() {
|
||||
val a: String
|
||||
val b: String
|
||||
if () {
|
||||
a = "a"
|
||||
a.capitalize()
|
||||
b = "b"
|
||||
b.capitalize()
|
||||
}
|
||||
|
||||
a.charAt(1)
|
||||
b.charAt(1)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
fun foo() {
|
||||
<caret>val a = "aaa"
|
||||
|
||||
a.charAt(1)
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fun foo() {
|
||||
val a: String
|
||||
if () {
|
||||
a = "aaa"
|
||||
}
|
||||
|
||||
a.charAt(1)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
fun foo() {
|
||||
<caret>var a: Boolean = true
|
||||
a = true
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fun foo() {
|
||||
var a: Boolean = false
|
||||
if (<caret>) {
|
||||
a = true
|
||||
}
|
||||
a = true
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
fun foo() {
|
||||
<caret>var a: String? = "aaa"
|
||||
a = "bbb"
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fun foo() {
|
||||
var a: String? = null
|
||||
if (<caret>) {
|
||||
a = "aaa"
|
||||
}
|
||||
a = "bbb"
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
fun foo() {
|
||||
<selection>var a: Int = 1
|
||||
var b: Char = 1
|
||||
var c: Byte = 1
|
||||
var d: Long = 1
|
||||
var e: Short = 1
|
||||
var f: Double = 1
|
||||
var g: Float = 1</selection>
|
||||
a = 2
|
||||
b = 2
|
||||
c = 2
|
||||
d = 2
|
||||
e = 2
|
||||
f = 2
|
||||
g = 2
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
fun foo() {
|
||||
var a: Int = 0
|
||||
var b: Char = 0
|
||||
var c: Byte = 0
|
||||
var d: Long = 0
|
||||
var e: Short = 0
|
||||
var f: Double = 0
|
||||
var g: Float = 0
|
||||
if (<caret>) {
|
||||
a = 1
|
||||
b = 1
|
||||
c = 1
|
||||
d = 1
|
||||
e = 1
|
||||
f = 1
|
||||
g = 1
|
||||
}
|
||||
a = 2
|
||||
b = 2
|
||||
c = 2
|
||||
d = 2
|
||||
e = 2
|
||||
f = 2
|
||||
g = 2
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
fun foo() {
|
||||
<caret>var a: String = "aaa"
|
||||
|
||||
a.charAt(1)
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fun foo() {
|
||||
var a: String
|
||||
if () {
|
||||
a = "aaa"
|
||||
}
|
||||
|
||||
a.charAt(1)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
fun foo() {
|
||||
<selection>var a: String
|
||||
a.capitalize()</selection>
|
||||
|
||||
a.charAt(1)
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fun foo() {
|
||||
var a: String
|
||||
if () {
|
||||
a.capitalize()
|
||||
}
|
||||
|
||||
a.charAt(1)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
fun foo() {
|
||||
<caret>var a = "aaa"
|
||||
|
||||
a.charAt(1)
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fun foo() {
|
||||
var a: String
|
||||
if () {
|
||||
a = "aaa"
|
||||
}
|
||||
|
||||
a.charAt(1)
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
fun foo() {
|
||||
<caret>val a: String? = "aaa"
|
||||
a.toString()
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fun foo() {
|
||||
val a: String?
|
||||
if (<caret>) {
|
||||
a = "aaa"
|
||||
} else {
|
||||
}
|
||||
a.toString()
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
fun foo() {
|
||||
<caret>var a: String? = "aaa"
|
||||
a = "bbb"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fun foo() {
|
||||
var a: String?
|
||||
if (<caret>) {
|
||||
a = "aaa"
|
||||
} else {
|
||||
}
|
||||
a = "bbb"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun foo() {
|
||||
<selection>val a = "aaa"
|
||||
val b = "aaa"</selection>
|
||||
|
||||
a.charAt(1)
|
||||
b.charAt(1)
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fun foo() {
|
||||
val a: String
|
||||
val b: String
|
||||
try {
|
||||
a = "aaa"
|
||||
b = "aaa"
|
||||
} catch(e: <selection>Exception</selection>) {
|
||||
}
|
||||
|
||||
a.charAt(1)
|
||||
b.charAt(1)
|
||||
}
|
||||
Reference in New Issue
Block a user