From 4fd028bb3bd88685fab3885f5a96b2e69432b1e6 Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 8 Nov 2011 15:43:53 +0100 Subject: [PATCH] a read action in debugger --- .../intellij/debugger/ui/EditorEvaluationCommand.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/EditorEvaluationCommand.java b/java/debugger/impl/src/com/intellij/debugger/ui/EditorEvaluationCommand.java index 495f9a3eb37e..f632ddc1b543 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/EditorEvaluationCommand.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/EditorEvaluationCommand.java @@ -24,6 +24,8 @@ import com.intellij.debugger.engine.evaluation.EvaluateException; import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; import com.intellij.debugger.engine.events.DebuggerContextCommandImpl; import com.intellij.debugger.impl.DebuggerContextImpl; +import com.intellij.openapi.application.AccessToken; +import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.progress.ProgressIndicator; @@ -57,7 +59,13 @@ public abstract class EditorEvaluationCommand extends DebuggerContextCommandI protected abstract T evaluate(EvaluationContextImpl evaluationContext) throws EvaluateException; public T evaluate() throws EvaluateException { - myProgressIndicator.setText(DebuggerBundle.message("progress.evaluating", myElement.getText())); + AccessToken token = ReadAction.start(); + try { + myProgressIndicator.setText(DebuggerBundle.message("progress.evaluating", myElement.getText())); + } + finally { + token.finish(); + } try { T result = evaluate(myDebuggerContext.createEvaluationContext());