Skip to content

Commit e5ce91d

Browse files
committed
Show receiver for invoke calls in smart step into popup
1 parent 9681f5c commit e5ce91d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSmartStepIntoHandler.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import com.intellij.psi.PsiDocumentManager
2525
import com.intellij.psi.PsiMethod
2626
import com.intellij.util.Range
2727
import com.intellij.util.containers.OrderedSet
28+
import org.jetbrains.kotlin.builtins.functions.FunctionInvokeDescriptor
2829
import org.jetbrains.kotlin.builtins.isSuspendFunctionType
2930
import org.jetbrains.kotlin.codegen.intrinsics.IntrinsicMethods
3031
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
@@ -35,6 +36,7 @@ import org.jetbrains.kotlin.idea.caches.resolve.analyze
3536
import org.jetbrains.kotlin.idea.caches.resolve.analyzeFully
3637
import org.jetbrains.kotlin.idea.codeInsight.CodeInsightUtils
3738
import org.jetbrains.kotlin.idea.codeInsight.DescriptorToSourceUtilsIde
39+
import org.jetbrains.kotlin.idea.util.application.runReadAction
3840
import org.jetbrains.kotlin.load.java.isFromJava
3941
import org.jetbrains.kotlin.psi.*
4042
import org.jetbrains.kotlin.resolve.BindingContext
@@ -186,7 +188,17 @@ class KotlinSmartStepIntoHandler : JvmSmartStepIntoHandler() {
186188
}
187189
}
188190

189-
val label = KotlinMethodSmartStepTarget.calcLabel(descriptor)
191+
val callLabel = KotlinMethodSmartStepTarget.calcLabel(descriptor)
192+
val label = when (descriptor) {
193+
is FunctionInvokeDescriptor -> {
194+
when (expression) {
195+
is KtSimpleNameExpression -> "${runReadAction { expression.text }}.$callLabel"
196+
else -> callLabel
197+
}
198+
}
199+
else -> callLabel
200+
}
201+
190202
result.add(KotlinMethodSmartStepTarget(descriptor, label, expression, lines))
191203
}
192204
}

0 commit comments

Comments
 (0)