mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
a read action in debugger
This commit is contained in:
@@ -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<T> 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());
|
||||
|
||||
Reference in New Issue
Block a user