Intentions: Implement "Introduce local variable" intention

#KT-11768 Fixed
This commit is contained in:
Alexey Sedunov
2016-04-13 17:37:17 +03:00
parent d75edb9876
commit aa4bfadfb1
25 changed files with 204 additions and 7 deletions
+1
View File
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.intentions.IntroduceVariableIntention
@@ -0,0 +1,5 @@
fun foo(a: Int, b: Int) = a + b
fun foo() {
foo(1 + 2, 3 * 4) <caret>//
}
@@ -0,0 +1,5 @@
fun foo(a: Int, b: Int) = a + b
fun foo() {
val foo = foo(1 + 2, 3 * 4)<caret> //
}
@@ -0,0 +1,5 @@
fun foo(a: Int, b: Int) = a + b
fun foo() {
foo(1 + 2, 3 * 4)<caret>
}
@@ -0,0 +1,5 @@
fun foo(a: Int, b: Int) = a + b
fun foo() {
val foo = foo(1 + 2, 3 * 4)<caret>
}
@@ -0,0 +1,5 @@
fun foo(a: Int, b: Int) = a + b
fun foo() {
<caret>foo(1 + 2, 3 * 4)
}
@@ -0,0 +1,5 @@
fun foo(a: Int, b: Int) = a + b
fun foo() {
val foo = foo(1 + 2, 3 * 4)<caret>
}
@@ -0,0 +1,5 @@
fun foo(a: Int, b: Int) = a + b
fun foo() {
foo(1 <caret>+ 2, 3 * 4)
}
@@ -0,0 +1,5 @@
fun foo(a: Int, b: Int) = a + b
fun foo() {
val foo = foo(1 + 2, 3 * 4)<caret>
}
@@ -0,0 +1,6 @@
// IS_APPLICABLE: false
fun foo(a: Int, b: Int) = a + b
fun foo() {
<caret> foo(1 + 2, 3 * 4)
}
+6
View File
@@ -0,0 +1,6 @@
// IS_APPLICABLE: false
fun foo(a: Int, b: Int) = a + b
fun foo() {
val foo = foo(1 + 2, 3 * 4)<caret>
}
@@ -0,0 +1,4 @@
// IS_APPLICABLE: false
fun foo(): Int {
return 1 + 2<caret>
}
@@ -0,0 +1,6 @@
// IS_APPLICABLE: false
fun foo(a: Int, b: Int) {}
fun foo() {
foo(1 + 2, 3 * 4)<caret>
}