Surround with: move declaration out from block
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user