diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/DebuggerUtils.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/DebuggerUtils.kt index 7428a598d2b..eebf8fcb9b9 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/DebuggerUtils.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/DebuggerUtils.kt @@ -36,6 +36,7 @@ import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall import org.jetbrains.kotlin.resolve.inline.InlineUtil import org.jetbrains.kotlin.resolve.jvm.JvmClassName import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedSimpleFunctionDescriptor +import org.jetbrains.kotlin.utils.addIfNotNull import java.util.* object DebuggerUtils { @@ -101,7 +102,8 @@ object DebuggerUtils { fun analyzeInlinedFunctions( resolutionFacadeForFile: ResolutionFacade, file: KtFile, - analyzeOnlyReifiedInlineFunctions: Boolean + analyzeOnlyReifiedInlineFunctions: Boolean, + bindingContext: BindingContext? = null ): Pair> { val analyzedElements = HashSet() val context = analyzeElementWithInline( @@ -109,7 +111,8 @@ object DebuggerUtils { file, 1, analyzedElements, - !analyzeOnlyReifiedInlineFunctions) + !analyzeOnlyReifiedInlineFunctions, bindingContext + ) //We processing another files just to annotate anonymous classes within their inline functions //Bytecode not produced for them cause of filtering via generateClassFilter @@ -135,11 +138,14 @@ object DebuggerUtils { element: KtElement, deep: Int, analyzedElements: MutableSet, - analyzeInlineFunctions: Boolean): BindingContext { + analyzeInlineFunctions: Boolean, + fullResolveContext: BindingContext? = null + ): BindingContext { val project = element.project val inlineFunctions = HashSet() val innerContexts = ArrayList() + innerContexts.addIfNotNull(fullResolveContext) element.accept(object : KtTreeVisitorVoid() { override fun visitExpression(expression: KtExpression) { diff --git a/idea/src/org/jetbrains/kotlin/idea/internal/KotlinBytecodeToolWindow.java b/idea/src/org/jetbrains/kotlin/idea/internal/KotlinBytecodeToolWindow.java index 42e6866a008..8ffe0cd71bb 100644 --- a/idea/src/org/jetbrains/kotlin/idea/internal/KotlinBytecodeToolWindow.java +++ b/idea/src/org/jetbrains/kotlin/idea/internal/KotlinBytecodeToolWindow.java @@ -292,8 +292,11 @@ public class KotlinBytecodeToolWindow extends JPanel implements Disposable { ) { ResolutionFacade resolutionFacade = ResolutionUtils.getResolutionFacade(ktFile); + BindingContext bindingContextForFile = resolutionFacade.analyzeFullyAndGetResult(Collections.singletonList(ktFile)).getBindingContext(); + kotlin.Pair> result = DebuggerUtils.INSTANCE.analyzeInlinedFunctions( - resolutionFacade, ktFile, configuration.getBoolean(CommonConfigurationKeys.DISABLE_INLINE) + resolutionFacade, ktFile, configuration.getBoolean(CommonConfigurationKeys.DISABLE_INLINE), + bindingContextForFile ); BindingContext bindingContext = result.getFirst();