diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/JavaEvaluationContextWrapper.kt b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/JavaEvaluationContextWrapper.kt index 4f9fa9418023..760aa8497fc0 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/JavaEvaluationContextWrapper.kt +++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/JavaEvaluationContextWrapper.kt @@ -14,7 +14,7 @@ import java.util.regex.Pattern internal class JavaEvaluationContextWrapper : EvaluationContextWrapper { companion object { @JvmField - val SYNTHETIC_VARIABLE_VALUE_KEY = Key.create<() -> Value>("SYNTHETIC_VARIABLE_VALUE_KEY") + val SYNTHETIC_VARIABLE_VALUE_KEY = Key.create<(EvaluationContext) -> Value>("SYNTHETIC_VARIABLE_VALUE_KEY") } override fun wrapContext(project: Project, context: PsiElement?, additionalElements: List): PsiElement? { diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/MarkedObjectAdditionalContextProvider.java b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/MarkedObjectAdditionalContextProvider.java index 4032ad8e0486..c1556a32a14a 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/MarkedObjectAdditionalContextProvider.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/MarkedObjectAdditionalContextProvider.java @@ -57,7 +57,7 @@ class MarkedObjectAdditionalContextProvider implements AdditionalContextProvider try { labelName += CodeFragmentFactoryContextWrapper.DEBUG_LABEL_SUFFIX; Type type = objectRef.type(); - result.add(new AdditionalContextElement(labelName, type.signature(), type.name(), () -> objectRef)); + result.add(new AdditionalContextElement(labelName, type.signature(), type.name(), __ -> objectRef)); } catch (ObjectCollectedException e) { //it.remove(); diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/EvaluatorBuilderImpl.java b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/EvaluatorBuilderImpl.java index 7daf3289d893..16c93ef64145 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/EvaluatorBuilderImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/EvaluatorBuilderImpl.java @@ -824,7 +824,7 @@ public final class EvaluatorBuilderImpl implements EvaluatorBuilder { myResult = new Evaluator() { @Override public Object evaluate(EvaluationContextImpl context) { - return computeSyntheticValue.invoke(); + return computeSyntheticValue.invoke(context); } }; return; diff --git a/java/debugger/openapi/src/com/intellij/debugger/engine/evaluation/EvaluationContextWrapper.kt b/java/debugger/openapi/src/com/intellij/debugger/engine/evaluation/EvaluationContextWrapper.kt index d13a89944765..a1e86cf3c4e5 100644 --- a/java/debugger/openapi/src/com/intellij/debugger/engine/evaluation/EvaluationContextWrapper.kt +++ b/java/debugger/openapi/src/com/intellij/debugger/engine/evaluation/EvaluationContextWrapper.kt @@ -45,4 +45,4 @@ interface AdditionalContextProvider { * @property value A lambda function returning a [Value] used for evaluation. */ @ApiStatus.Internal -data class AdditionalContextElement(val name: String, val jvmSignature: String, val jvmTypeName: String, val value: () -> Value) +data class AdditionalContextElement(val name: String, val jvmSignature: String, val jvmTypeName: String, val value: (EvaluationContext) -> Value) diff --git a/plugins/kotlin/jvm-debugger/evaluation/src/org/jetbrains/kotlin/idea/debugger/evaluate/variables/VariableFinder.kt b/plugins/kotlin/jvm-debugger/evaluation/src/org/jetbrains/kotlin/idea/debugger/evaluate/variables/VariableFinder.kt index 537485e28ace..d7cf00a784b9 100644 --- a/plugins/kotlin/jvm-debugger/evaluation/src/org/jetbrains/kotlin/idea/debugger/evaluate/variables/VariableFinder.kt +++ b/plugins/kotlin/jvm-debugger/evaluation/src/org/jetbrains/kotlin/idea/debugger/evaluate/variables/VariableFinder.kt @@ -294,7 +294,7 @@ class VariableFinder(val context: ExecutionContext) { val contextElements = AdditionalContextProvider .getAllAdditionalContextElements(codeFragment.project, codeFragment.context) val element = contextElements.firstOrNull { it.name == foreignValueName } ?: return null - return Result(element.value()) + return Result(element.value(context.evaluationContext)) } private fun findUnlabeledThis(kind: VariableKind.UnlabeledThis): Result? {