Debugger: Fix "smart step into" for library declarations (KT-33303)

This commit is contained in:
Yan Zhulanow
2019-10-10 21:16:54 +09:00
parent c6a5733b3d
commit 9cc7ff0efc
4 changed files with 27 additions and 1 deletions
@@ -11,6 +11,7 @@ import com.intellij.util.Range
import org.jetbrains.kotlin.builtins.functions.FunctionInvokeDescriptor
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.idea.KotlinIcons
import org.jetbrains.kotlin.idea.decompiler.navigation.SourceNavigationHelper
import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers
import org.jetbrains.kotlin.load.java.JvmAbi
import org.jetbrains.kotlin.psi.KtDeclaration
@@ -21,11 +22,13 @@ import javax.swing.Icon
class KotlinMethodSmartStepTarget(
descriptor: CallableMemberDescriptor,
val declaration: KtDeclaration?,
declaration: KtDeclaration?,
label: String,
highlightElement: PsiElement,
lines: Range<Int>
) : SmartStepTarget(label, highlightElement, false, lines) {
val declaration = declaration?.let(SourceNavigationHelper::getNavigationElement)
val isInvoke = descriptor is FunctionInvokeDescriptor
init {
@@ -1261,6 +1261,11 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest {
runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoWithOverrides.kt");
}
@TestMetadata("stepIntoLibWithSources.kt")
public void testStepIntoLibWithSources() throws Exception {
runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/stepIntoLibWithSources.kt");
}
@TestMetadata("stepIntoStdlibInlineFun2step.kt")
public void testStepIntoStdlibInlineFun2step() throws Exception {
runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/stepIntoStdlibInlineFun2step.kt");
@@ -0,0 +1,10 @@
package stepIntoLibWithSources
import java.io.StringReader
fun main() {
//Breakpoint!
val text = StringReader("OK").readText()
}
// SMART_STEP_INTO_BY_INDEX: 2
@@ -0,0 +1,8 @@
LineBreakpoint created at stepIntoLibWithSources.kt:7
Run Java
Connected to the target VM
stepIntoLibWithSources.kt:7
ReadWrite.!EXT!
Disconnected from the target VM
Process finished with exit code 0