mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[spring debugger] Provide EvaluationContext for AdditionalContextProvider
* also rewrite to DebugProcess.invokeMethod calls Merge-request: IJ-MR-148115 Merged-by: Maksim Zuev <Maksim.Zuev@jetbrains.com> GitOrigin-RevId: f3b7f44d427405339fdb836dd90dea40dcf28c73
This commit is contained in:
committed by
intellij-monorepo-bot
parent
29dcc650d6
commit
11650ac412
+1
-1
@@ -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<AdditionalContextElement>): PsiElement? {
|
||||
|
||||
+1
-1
@@ -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();
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
+1
-1
@@ -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? {
|
||||
|
||||
Reference in New Issue
Block a user