Skip MultiFileFacade classes as synthethic

This commit is contained in:
Natalia Ukhorskaya
2015-10-14 20:11:04 +03:00
parent 556e08b9eb
commit f9399f0510
17 changed files with 73 additions and 23 deletions
@@ -17,10 +17,9 @@
package org.jetbrains.kotlin.idea.debugger.filter
import com.intellij.debugger.engine.SyntheticTypeComponentProvider
import com.sun.jdi.AbsentInformationException
import com.sun.jdi.Method
import com.sun.jdi.TypeComponent
import org.jetbrains.kotlin.load.kotlin.PackageClassUtils
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.FqNameUnsafe
public class KotlinSyntheticTypeComponentProvider: SyntheticTypeComponentProvider {
@@ -30,6 +29,17 @@ public class KotlinSyntheticTypeComponentProvider: SyntheticTypeComponentProvide
val typeName = typeComponent.declaringType().name()
if (!FqNameUnsafe.isValid(typeName)) return false
return false
try {
if (typeComponent.location().lineNumber() != 1) return false
if (typeComponent.allLineLocations().any { it.lineNumber() != 1 }) {
return false
}
return !typeComponent.declaringType().allLineLocations().any { it.lineNumber() != 1 }
}
catch(e: AbsentInformationException) {
return false
}
}
}
@@ -1,3 +1,5 @@
@file:JvmName("SameNameBreakpointOnLocalProperty")
@file:JvmMultifileClass
package customLib.breakpointOnLocalProperty
public fun breakpointOnLocalPropertyFun(): Int {
@@ -1,3 +1,5 @@
@file:JvmName("SameNameBreakpointOnLocalProperty")
@file:JvmMultifileClass
package customLib.breakpointOnLocalProperty
public fun breakpointOnLocalPropertyFun2(): Int {
@@ -0,0 +1,7 @@
@file:JvmName("SameNameOneFunSameFileName")
@file:JvmMultifileClass
package customLib.oneFunSameClassName
public fun oneFunSameFileNameFun(): Int {
return 1
}
@@ -0,0 +1,7 @@
@file:JvmName("SameNameOneFunSameFileName")
@file:JvmMultifileClass
package customLib.oneFunSameClassName
public fun oneFunSameFileNameFun2(): Int {
return 1
}
@@ -1,5 +0,0 @@
package customLib.oneFunSameFileName
public fun oneFunSameFileNameFun(): Int {
return 1
}
@@ -1,5 +0,0 @@
package customLib.oneFunSameFileName
public fun oneFunSameFileNameFun2(): Int {
return 1
}
@@ -1,3 +1,5 @@
@file:JvmName("SameNameProperty")
@file:JvmMultifileClass
package customLib.property
public val foo: Int =
@@ -1,3 +1,5 @@
@file:JvmName("SameNameProperty")
@file:JvmMultifileClass
package customLib.property
public fun someFun(): Int {
@@ -1,3 +1,5 @@
@file:JvmName("SameNameTwoFunDifferentSignature")
@file:JvmMultifileClass
package customLib.twoFunDifferentSignature
public fun twoFunDifferentSignatureFun(): Int {
@@ -1,3 +1,5 @@
@file:JvmName("SameNameTwoFunDifferentSignature")
@file:JvmMultifileClass
package customLib.twoFunDifferentSignature
public fun twoFunDifferentSignatureFun(i: Int): Int {
+8 -8
View File
@@ -1,17 +1,17 @@
LineBreakpoint created at a1.kt:3
LineBreakpoint created at a1.kt:3
LineBreakpoint created at a1.kt:3
LineBreakpoint created at a1.kt:3
LineBreakpoint created at a1.kt:5
LineBreakpoint created at a1.kt:5
LineBreakpoint created at a1.kt:5
LineBreakpoint created at a1.kt:5
LineBreakpoint created at simpleLibFile.kt:3
!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! customLibClassName.CustomLibClassNameKt
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
a1.kt:4
a1.kt:6
Compile bytecode for 1 + 1
a1.kt:4
a1.kt:6
Compile bytecode for 1 + 2
a1.kt:4
a1.kt:6
Compile bytecode for 1 + 3
a1.kt:4
a1.kt:6
Compile bytecode for 1 + 4
simpleLibFile.kt:4
Compile bytecode for 1 + 5
@@ -0,0 +1,9 @@
LineBreakpoint created at stepIntoMultiFileFacade.kt:5
!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! stepIntoMultiFileFacade.StepIntoMultiFileFacadeKt
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
stepIntoMultiFileFacade.kt:5
a1.kt:6
stepIntoMultiFileFacade.kt:5
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0
+1 -1
View File
@@ -2,7 +2,7 @@ LineBreakpoint created at stepIntoStdlib.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! stepIntoStdlib.StepIntoStdlibKt
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
stepIntoStdlib.kt:6
ArraysKt.!EXT!
_Arrays.!EXT!
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0
@@ -1,7 +1,7 @@
package customLibClassName
fun main(args: Array<String>) {
customLib.oneFunSameFileName.oneFunSameFileNameFun()
customLib.oneFunSameClassName.oneFunSameFileNameFun()
customLib.twoFunDifferentSignature.twoFunDifferentSignatureFun()
customLib.property.foo
customLib.breakpointOnLocalProperty.breakpointOnLocalPropertyFun()
@@ -0,0 +1,9 @@
package stepIntoMultiFileFacade
fun main(args: Array<String>) {
//Breakpoint!
customLib.oneFunSameClassName.oneFunSameFileNameFun()
}
// STEP_INTO: 2
// TRACING_FILTERS_ENABLED: false
@@ -454,6 +454,12 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest {
doStepIntoTest(fileName);
}
@TestMetadata("stepIntoMultiFileFacade.kt")
public void testStepIntoMultiFileFacade() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepping/filters/stepIntoMultiFileFacade.kt");
doStepIntoTest(fileName);
}
@TestMetadata("stepIntoSpecificKotlinClasses.kt")
public void testStepIntoSpecificKotlinClasses() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepping/filters/stepIntoSpecificKotlinClasses.kt");