diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSimpleGetterProvider.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSimpleGetterProvider.kt index 261bb6cdcbe..c4f5f146041 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSimpleGetterProvider.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSimpleGetterProvider.kt @@ -46,7 +46,7 @@ class KotlinSimpleGetterProvider : SimplePropertyGetterProvider { val property = PsiTreeUtil.getParentOfType(element, KtProperty::class.java) // val a = foo() if (property != null) { - return property.getter == null + return property.getter == null && !property.isLocal } return false diff --git a/idea/testData/debugger/tinyApp/outs/skipSimpleGetter.out b/idea/testData/debugger/tinyApp/outs/skipSimpleGetter.out index f01d3fec9f3..c1934b73180 100644 --- a/idea/testData/debugger/tinyApp/outs/skipSimpleGetter.out +++ b/idea/testData/debugger/tinyApp/outs/skipSimpleGetter.out @@ -1,8 +1,8 @@ -LineBreakpoint created at skipSimpleGetter.kt:6 +LineBreakpoint created at skipSimpleGetter.kt:8 !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! skipSimpleGetter.SkipSimpleGetterKt Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' -skipSimpleGetter.kt:6 -skipSimpleGetter.kt:7 +skipSimpleGetter.kt:8 +skipSimpleGetter.kt:9 Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' Process finished with exit code 0 diff --git a/idea/testData/debugger/tinyApp/outs/skipSimpleGetterLocalVal.out b/idea/testData/debugger/tinyApp/outs/skipSimpleGetterLocalVal.out new file mode 100644 index 00000000000..142a01762d5 --- /dev/null +++ b/idea/testData/debugger/tinyApp/outs/skipSimpleGetterLocalVal.out @@ -0,0 +1,8 @@ +LineBreakpoint created at skipSimpleGetterLocalVal.kt:13 +!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! skipSimpleGetterLocalVal.SkipSimpleGetterLocalValKt +Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' +skipSimpleGetterLocalVal.kt:13 +skipSimpleGetterLocalVal.kt:15 +Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' + +Process finished with exit code 0 diff --git a/idea/testData/debugger/tinyApp/outs/skipSimpleGetterMethodWithProperty.out b/idea/testData/debugger/tinyApp/outs/skipSimpleGetterMethodWithProperty.out new file mode 100644 index 00000000000..8f6f81ac3e3 --- /dev/null +++ b/idea/testData/debugger/tinyApp/outs/skipSimpleGetterMethodWithProperty.out @@ -0,0 +1,8 @@ +LineBreakpoint created at skipSimpleGetterMethodWithProperty.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! skipSimpleGetterMethodWithProperty.SkipSimpleGetterMethodWithPropertyKt +Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' +skipSimpleGetterMethodWithProperty.kt:5 +skipSimpleGetterMethodWithProperty.kt:10 +Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' + +Process finished with exit code 0 diff --git a/idea/testData/debugger/tinyApp/src/stepping/stepInto/skipSimpleGetter.kt b/idea/testData/debugger/tinyApp/src/stepping/stepInto/skipSimpleGetter.kt index ab6bcf4ca9d..4160d840be7 100644 --- a/idea/testData/debugger/tinyApp/src/stepping/stepInto/skipSimpleGetter.kt +++ b/idea/testData/debugger/tinyApp/src/stepping/stepInto/skipSimpleGetter.kt @@ -1,9 +1,11 @@ package skipSimpleGetter +val top = 1 + fun main(args: Array) { val a = A(1) //Breakpoint! - a.a1 + a.a2 + a.a3 + a.a4 + a.a1 + a.a2 + a.a3 + a.a4 + top } class A(val a4: Int) { @@ -21,5 +23,5 @@ class A(val a4: Int) { } } -// STEP_INTO: 21 +// STEP_INTO: 3 // SKIP_GETTERS: true \ No newline at end of file diff --git a/idea/testData/debugger/tinyApp/src/stepping/stepInto/skipSimpleGetterLocalVal.kt b/idea/testData/debugger/tinyApp/src/stepping/stepInto/skipSimpleGetterLocalVal.kt new file mode 100644 index 00000000000..e59c1a8126b --- /dev/null +++ b/idea/testData/debugger/tinyApp/src/stepping/stepInto/skipSimpleGetterLocalVal.kt @@ -0,0 +1,20 @@ +package skipSimpleGetterLocalVal + +fun main(args: Array) { + class Test { + val a2 = 12 + } + + val t = Test() + + val a1 = 1 + + //Breakpoint! + a1 + t.a2 // 1 + + foo() // 2 +} + +fun foo() {} + +// SKIP_GETTERS: true \ No newline at end of file diff --git a/idea/testData/debugger/tinyApp/src/stepping/stepInto/skipSimpleGetterMethodWithProperty.kt b/idea/testData/debugger/tinyApp/src/stepping/stepInto/skipSimpleGetterMethodWithProperty.kt new file mode 100644 index 00000000000..f46cabb501b --- /dev/null +++ b/idea/testData/debugger/tinyApp/src/stepping/stepInto/skipSimpleGetterMethodWithProperty.kt @@ -0,0 +1,16 @@ +package skipSimpleGetterMethodWithProperty + +fun main(args: Array) { + //Breakpoint! + test() + foo() +} + +fun test() { + var a = 12 + foo() +} + +fun foo() {} + +// SKIP_GETTERS: true \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java index d1f32c8b32b..a9927a7df79 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java @@ -277,6 +277,18 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest { doStepIntoTest(fileName); } + @TestMetadata("skipSimpleGetterLocalVal.kt") + public void testSkipSimpleGetterLocalVal() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepping/stepInto/skipSimpleGetterLocalVal.kt"); + doStepIntoTest(fileName); + } + + @TestMetadata("skipSimpleGetterMethodWithProperty.kt") + public void testSkipSimpleGetterMethodWithProperty() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepping/stepInto/skipSimpleGetterMethodWithProperty.kt"); + doStepIntoTest(fileName); + } + @TestMetadata("stepIntoFromInlineFun.kt") public void testStepIntoFromInlineFun() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepping/stepInto/stepIntoFromInlineFun.kt");