From c8f57e007cf6d330adbaa0992d0f908da44c52bc Mon Sep 17 00:00:00 2001 From: Natalia Ukhorskaya Date: Tue, 21 Jul 2015 16:10:06 +0300 Subject: [PATCH] Fix smart step into functions with expression body --- .../idea/debugger/stepping/KotlinSmartStepIntoHandler.kt | 2 +- .../debugger/smartStepInto/funWithExpressionBody.kt | 5 +++++ .../kotlin/idea/debugger/SmartStepIntoTestGenerated.java | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 idea/testData/debugger/smartStepInto/funWithExpressionBody.kt diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSmartStepIntoHandler.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSmartStepIntoHandler.kt index 1a4ed04da62..7dfe28e451f 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSmartStepIntoHandler.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSmartStepIntoHandler.kt @@ -62,7 +62,7 @@ public class KotlinSmartStepIntoHandler : JvmSmartStepIntoHandler() { val doc = PsiDocumentManager.getInstance(file.getProject()).getDocument(file) ?: return emptyList() val lines = Range(doc.getLineNumber(elementTextRange.getStartOffset()), doc.getLineNumber(elementTextRange.getEndOffset())) - val bindingContext = element.analyze() + val bindingContext = element.analyzeFully() val result = OrderedSet() // TODO support class initializers, local functions, delegated properties with specified type, setter for properties diff --git a/idea/testData/debugger/smartStepInto/funWithExpressionBody.kt b/idea/testData/debugger/smartStepInto/funWithExpressionBody.kt new file mode 100644 index 00000000000..66fe75435dd --- /dev/null +++ b/idea/testData/debugger/smartStepInto/funWithExpressionBody.kt @@ -0,0 +1,5 @@ +fun foo() = bar() + +fun bar() = 1 + +// EXISTS: bar() \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/SmartStepIntoTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/debugger/SmartStepIntoTestGenerated.java index 74e1943ab19..b4981a07a3b 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/SmartStepIntoTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/SmartStepIntoTestGenerated.java @@ -101,6 +101,12 @@ public class SmartStepIntoTestGenerated extends AbstractSmartStepIntoTest { doTest(fileName); } + @TestMetadata("funWithExpressionBody.kt") + public void testFunWithExpressionBody() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/smartStepInto/funWithExpressionBody.kt"); + doTest(fileName); + } + @TestMetadata("if.kt") public void testIf() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/smartStepInto/if.kt");