mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[debugger] IDEA-335294 Do not step into simple properties
GitOrigin-RevId: 4b400b0db8d7b523277c02102e6ded8f259355ad
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d43ecf6516
commit
d32f883e2e
@@ -7,11 +7,12 @@ import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.util.PsiTreeUtil
|
||||
import org.jetbrains.kotlin.idea.base.psi.singleExpressionBody
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getParentOfType
|
||||
|
||||
class KotlinSimpleGetterProvider : SimplePropertyGetterProvider {
|
||||
override fun isInsideSimpleGetter(element: PsiElement): Boolean {
|
||||
// class A(val a: Int)
|
||||
if (element is KtParameter) {
|
||||
if (element.getParentOfType<KtParameter>(false) != null) {
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@@ -1658,6 +1658,11 @@ public abstract class K2IdeK1CodeKotlinSteppingTestGenerated extends AbstractK2I
|
||||
runTest("../testData/stepping/custom/simpleConditionalBreakpoint.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("skipSimpleGetters.kt")
|
||||
public void testSkipSimpleGetters() throws Exception {
|
||||
runTest("../testData/stepping/custom/skipSimpleGetters.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("smartStepIntoAsyncLambda.kt")
|
||||
public void testSmartStepIntoAsyncLambda() throws Exception {
|
||||
runTest("../testData/stepping/custom/smartStepIntoAsyncLambda.kt");
|
||||
|
||||
@@ -1658,6 +1658,11 @@ public abstract class K2IdeK2CodeKotlinSteppingTestGenerated extends AbstractK2I
|
||||
runTest("../testData/stepping/custom/simpleConditionalBreakpoint.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("skipSimpleGetters.kt")
|
||||
public void testSkipSimpleGetters() throws Exception {
|
||||
runTest("../testData/stepping/custom/skipSimpleGetters.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("smartStepIntoAsyncLambda.kt")
|
||||
public void testSmartStepIntoAsyncLambda() throws Exception {
|
||||
runTest("../testData/stepping/custom/smartStepIntoAsyncLambda.kt");
|
||||
|
||||
@@ -1658,6 +1658,11 @@ public abstract class K2IndyLambdaKotlinSteppingTestGenerated extends AbstractK2
|
||||
runTest("../testData/stepping/custom/simpleConditionalBreakpoint.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("skipSimpleGetters.kt")
|
||||
public void testSkipSimpleGetters() throws Exception {
|
||||
runTest("../testData/stepping/custom/skipSimpleGetters.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("smartStepIntoAsyncLambda.kt")
|
||||
public void testSmartStepIntoAsyncLambda() throws Exception {
|
||||
runTest("../testData/stepping/custom/smartStepIntoAsyncLambda.kt");
|
||||
|
||||
@@ -1658,6 +1658,11 @@ public abstract class IndyLambdaIrKotlinSteppingTestGenerated extends AbstractIn
|
||||
runTest("testData/stepping/custom/simpleConditionalBreakpoint.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("skipSimpleGetters.kt")
|
||||
public void testSkipSimpleGetters() throws Exception {
|
||||
runTest("testData/stepping/custom/skipSimpleGetters.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("smartStepIntoAsyncLambda.kt")
|
||||
public void testSmartStepIntoAsyncLambda() throws Exception {
|
||||
runTest("testData/stepping/custom/smartStepIntoAsyncLambda.kt");
|
||||
|
||||
@@ -1658,6 +1658,11 @@ public abstract class IrKotlinSteppingTestGenerated extends AbstractIrKotlinStep
|
||||
runTest("testData/stepping/custom/simpleConditionalBreakpoint.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("skipSimpleGetters.kt")
|
||||
public void testSkipSimpleGetters() throws Exception {
|
||||
runTest("testData/stepping/custom/skipSimpleGetters.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("smartStepIntoAsyncLambda.kt")
|
||||
public void testSmartStepIntoAsyncLambda() throws Exception {
|
||||
runTest("testData/stepping/custom/smartStepIntoAsyncLambda.kt");
|
||||
|
||||
@@ -1658,6 +1658,11 @@ public abstract class K1IdeK2CodeKotlinSteppingTestGenerated extends AbstractK1I
|
||||
runTest("testData/stepping/custom/simpleConditionalBreakpoint.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("skipSimpleGetters.kt")
|
||||
public void testSkipSimpleGetters() throws Exception {
|
||||
runTest("testData/stepping/custom/skipSimpleGetters.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("smartStepIntoAsyncLambda.kt")
|
||||
public void testSmartStepIntoAsyncLambda() throws Exception {
|
||||
runTest("testData/stepping/custom/smartStepIntoAsyncLambda.kt");
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
fun foo(name: String, age: Int): Any {
|
||||
return name
|
||||
}
|
||||
|
||||
class User1(
|
||||
val name: String,
|
||||
val age: Int
|
||||
)
|
||||
|
||||
private fun test1() {
|
||||
val user = User1("", 0)
|
||||
// STEP_INTO: 1
|
||||
// RESUME: 1
|
||||
//Breakpoint!
|
||||
foo(user.name, user.age)
|
||||
}
|
||||
|
||||
class User2(val name: String, val age: Int)
|
||||
|
||||
private fun test2() {
|
||||
val user = User2("", 0)
|
||||
// STEP_INTO: 1
|
||||
// RESUME: 1
|
||||
//Breakpoint!
|
||||
foo(user.name, user.age)
|
||||
}
|
||||
|
||||
fun main() {
|
||||
test1()
|
||||
test2()
|
||||
}
|
||||
|
||||
// SKIP_GETTERS: true
|
||||
@@ -0,0 +1,11 @@
|
||||
LineBreakpoint created at skipSimpleGetters.kt:15
|
||||
LineBreakpoint created at skipSimpleGetters.kt:25
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
skipSimpleGetters.kt:15
|
||||
skipSimpleGetters.kt:2
|
||||
skipSimpleGetters.kt:25
|
||||
skipSimpleGetters.kt:2
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
Reference in New Issue
Block a user