Convert Object Literal to Lambda Intention: Move lambda out of parentheses when possible. Fix after-template

#KT-10778 Fixed
This commit is contained in:
Alexey Sedunov
2016-01-27 16:06:38 +03:00
parent 1c65797950
commit 26c47cda47
11 changed files with 84 additions and 29 deletions
@@ -0,0 +1,7 @@
package source;
public class J {
static void foo(Runnable r, int n) {
}
}
@@ -0,0 +1,5 @@
package source
fun bar() {
J.foo({ println("a") }, 1)
}
@@ -0,0 +1,7 @@
package source;
public class J {
static void foo(Runnable r, int n) {
}
}
@@ -0,0 +1,9 @@
package source
fun bar() {
J.foo(<caret>object : Runnable {
override fun run() {
println("a")
}
}, 1)
}
@@ -0,0 +1,6 @@
{
"mainFile": "source/test.kt",
"intentionClass": "org.jetbrains.kotlin.idea.intentions.ObjectLiteralToLambdaIntention",
"intentionText": "Convert to lambda",
"withRuntime": "true"
}