Support smart step into for inline function arguments
This commit is contained in:
@@ -4,4 +4,4 @@ fun foo() {
|
||||
|
||||
inline fun f1(f: () -> Unit) {}
|
||||
|
||||
// EXISTS: f1(() -> Unit)
|
||||
// EXISTS: f1(() -> Unit), f1: f.invoke()
|
||||
@@ -0,0 +1,7 @@
|
||||
fun foo() {
|
||||
<caret>f1(fun () { })
|
||||
}
|
||||
|
||||
inline fun f1(f: () -> Unit) {}
|
||||
|
||||
// EXISTS: f1(() -> Unit), f1: f.invoke()
|
||||
@@ -0,0 +1,13 @@
|
||||
LineBreakpoint created at smartStepIntoInlinedFunLiteral.kt:6
|
||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !OUTPUT_PATH!;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! smartStepIntoInlinedFunLiteral.SmartStepIntoInlinedFunLiteralKt
|
||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||
smartStepIntoInlinedFunLiteral.kt:6
|
||||
smartStepIntoInlinedFunLiteral.kt:9
|
||||
smartStepIntoInlinedFunLiteral.kt:10
|
||||
smartStepIntoInlinedFunLiteral.kt:13
|
||||
smartStepIntoInlinedFunLiteral.kt:14
|
||||
smartStepIntoInlinedFunLiteral.kt:18
|
||||
smartStepIntoInlinedFunLiteral.kt:20
|
||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||
|
||||
Process finished with exit code 0
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
LineBreakpoint created at smartStepIntoInlinedFunctionalExpression.kt:6
|
||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !OUTPUT_PATH!;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! smartStepIntoInlinedFunctionalExpression.SmartStepIntoInlinedFunctionalExpressionKt
|
||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||
smartStepIntoInlinedFunctionalExpression.kt:6
|
||||
smartStepIntoInlinedFunctionalExpression.kt:9
|
||||
smartStepIntoInlinedFunctionalExpression.kt:10
|
||||
smartStepIntoInlinedFunctionalExpression.kt:13
|
||||
smartStepIntoInlinedFunctionalExpression.kt:14
|
||||
smartStepIntoInlinedFunctionalExpression.kt:18
|
||||
smartStepIntoInlinedFunctionalExpression.kt:20
|
||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||
|
||||
Process finished with exit code 0
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package smartStepIntoInlinedFunLiteral
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val array = arrayOf(1, 2)
|
||||
//Breakpoint!
|
||||
val myClass = MyClass()
|
||||
|
||||
// smart step into f2.invoke(), one-line lambda
|
||||
myClass.f1 { test() }
|
||||
.f2 { test() }
|
||||
|
||||
// smart step into map.invoke(), multiline lambda
|
||||
array.map {
|
||||
it *2
|
||||
}
|
||||
|
||||
// smart step into filter.invoke()
|
||||
array.map { it * 2 }
|
||||
.filter {
|
||||
it > 2
|
||||
}
|
||||
}
|
||||
|
||||
class MyClass {
|
||||
inline fun f1(f1Param: () -> Unit): MyClass {
|
||||
test()
|
||||
f1Param()
|
||||
return this
|
||||
}
|
||||
|
||||
inline fun f2(f1Param: () -> Unit): MyClass {
|
||||
test()
|
||||
f1Param()
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {}
|
||||
|
||||
// STEP_OVER: 1
|
||||
// SMART_STEP_INTO_BY_INDEX: 4
|
||||
// STEP_OVER: 1
|
||||
// SMART_STEP_INTO_BY_INDEX: 2
|
||||
// STEP_OVER: 1
|
||||
// SMART_STEP_INTO_BY_INDEX: 4
|
||||
Vendored
+45
@@ -0,0 +1,45 @@
|
||||
package smartStepIntoInlinedFunctionalExpression
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val array = arrayOf(1, 2)
|
||||
//Breakpoint!
|
||||
val myClass = MyClass()
|
||||
|
||||
// smart step into f2.invoke(), one-line lambda
|
||||
myClass.f1(fun () { test() })
|
||||
.f2(fun () { test() })
|
||||
|
||||
// smart step into map.invoke(), multiline lambda
|
||||
array.map(fun (it): Int {
|
||||
return it * 2
|
||||
})
|
||||
|
||||
// smart step into filter.invoke()
|
||||
array.map(fun (it): Int { return it * 2 })
|
||||
.filter(fun (it): Boolean {
|
||||
return it > 2
|
||||
})
|
||||
}
|
||||
|
||||
class MyClass {
|
||||
inline fun f1(f1Param: () -> Unit): MyClass {
|
||||
test()
|
||||
f1Param()
|
||||
return this
|
||||
}
|
||||
|
||||
inline fun f2(f1Param: () -> Unit): MyClass {
|
||||
test()
|
||||
f1Param()
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {}
|
||||
|
||||
// STEP_OVER: 1
|
||||
// SMART_STEP_INTO_BY_INDEX: 4
|
||||
// STEP_OVER: 1
|
||||
// SMART_STEP_INTO_BY_INDEX: 2
|
||||
// STEP_OVER: 1
|
||||
// SMART_STEP_INTO_BY_INDEX: 4
|
||||
Reference in New Issue
Block a user