Search in sources :

Example 6 with XDebuggerEvaluator

use of com.intellij.xdebugger.evaluation.XDebuggerEvaluator in project intellij-community by JetBrains.

the class XDebuggerEvaluationDialog method startEvaluation.

public void startEvaluation(@NotNull XDebuggerEvaluator.XEvaluationCallback evaluationCallback) {
    final XDebuggerEditorBase inputEditor = getInputEditor();
    inputEditor.saveTextInHistory();
    XExpression expression = inputEditor.getExpression();
    XDebuggerEvaluator evaluator = mySession.getDebugProcess().getEvaluator();
    if (evaluator == null) {
        evaluationCallback.errorOccurred(XDebuggerBundle.message("xdebugger.evaluate.stack.frame.has.not.evaluator"));
    } else {
        evaluator.evaluate(expression, evaluationCallback, null);
    }
}
Also used : XDebuggerEvaluator(com.intellij.xdebugger.evaluation.XDebuggerEvaluator) XDebuggerEditorBase(com.intellij.xdebugger.impl.ui.XDebuggerEditorBase)

Example 7 with XDebuggerEvaluator

use of com.intellij.xdebugger.evaluation.XDebuggerEvaluator in project intellij-community by JetBrains.

the class XDebuggerTestUtil method evaluate.

private static Pair<XValue, String> evaluate(XDebugSession session, XExpression expression, long timeout) {
    XStackFrame frame = session.getCurrentStackFrame();
    assertNotNull(frame);
    XDebuggerEvaluator evaluator = frame.getEvaluator();
    assertNotNull(evaluator);
    XTestEvaluationCallback callback = new XTestEvaluationCallback();
    evaluator.evaluate(expression, callback, session.getCurrentPosition());
    return callback.waitFor(timeout);
}
Also used : XDebuggerEvaluator(com.intellij.xdebugger.evaluation.XDebuggerEvaluator)

Aggregations

XDebuggerEvaluator (com.intellij.xdebugger.evaluation.XDebuggerEvaluator)7 NotNull (org.jetbrains.annotations.NotNull)4 Editor (com.intellij.openapi.editor.Editor)3 TextRange (com.intellij.openapi.util.TextRange)3 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 XDebugSession (com.intellij.xdebugger.XDebugSession)2 XStackFrame (com.intellij.xdebugger.frame.XStackFrame)2 XValue (com.intellij.xdebugger.frame.XValue)2 Nullable (org.jetbrains.annotations.Nullable)2 Promise (org.jetbrains.concurrency.Promise)2 GoIcons (com.goide.GoIcons)1 DlvApi (com.goide.dlv.protocol.DlvApi)1 DlvRequest (com.goide.dlv.protocol.DlvRequest)1 com.goide.psi (com.goide.psi)1 GoSdkService (com.goide.sdk.GoSdkService)1 ModuleBasedConfiguration (com.intellij.execution.configurations.ModuleBasedConfiguration)1 RunProfile (com.intellij.execution.configurations.RunProfile)1 ConsoleExecuteAction (com.intellij.execution.console.ConsoleExecuteAction)1 LanguageConsoleView (com.intellij.execution.console.LanguageConsoleView)1 ConsoleView (com.intellij.execution.ui.ConsoleView)1