Search in sources :

Example 1 with XDebuggerEvaluationDialog

use of com.intellij.xdebugger.impl.evaluate.XDebuggerEvaluationDialog in project intellij-community by JetBrains.

the class XDebuggerEvaluateActionHandler method showDialog.

private static void showDialog(@NotNull XDebugSession session, VirtualFile file, XDebuggerEditorsProvider editorsProvider, XStackFrame stackFrame, XDebuggerEvaluator evaluator, @NotNull XExpression expression) {
    if (expression.getLanguage() == null) {
        Language language = null;
        if (stackFrame != null) {
            XSourcePosition position = stackFrame.getSourcePosition();
            if (position != null) {
                language = LanguageUtil.getFileLanguage(position.getFile());
            }
        }
        if (language == null && file != null) {
            language = LanguageUtil.getFileTypeLanguage(file.getFileType());
        }
        expression = new XExpressionImpl(expression.getExpression(), language, expression.getCustomInfo(), expression.getMode());
    }
    new XDebuggerEvaluationDialog(session, editorsProvider, evaluator, expression, stackFrame == null ? null : stackFrame.getSourcePosition()).show();
}
Also used : Language(com.intellij.lang.Language) XExpressionImpl(com.intellij.xdebugger.impl.breakpoints.XExpressionImpl) XSourcePosition(com.intellij.xdebugger.XSourcePosition) XDebuggerEvaluationDialog(com.intellij.xdebugger.impl.evaluate.XDebuggerEvaluationDialog)

Example 2 with XDebuggerEvaluationDialog

use of com.intellij.xdebugger.impl.evaluate.XDebuggerEvaluationDialog in project intellij-community by JetBrains.

the class XJumpToSourceActionBase method perform.

@Override
protected void perform(final XValueNodeImpl node, @NotNull final String nodeName, final AnActionEvent e) {
    XValue value = node.getValueContainer();
    final XDebuggerEvaluationDialog dialog = e.getData(XDebuggerEvaluationDialog.KEY);
    XNavigatable navigatable = sourcePosition -> {
        if (sourcePosition != null) {
            final Project project = node.getTree().getProject();
            AppUIUtil.invokeOnEdt(() -> {
                sourcePosition.createNavigatable(project).navigate(true);
                if (dialog != null && Registry.is("debugger.close.dialog.on.navigate")) {
                    dialog.close(DialogWrapper.CANCEL_EXIT_CODE);
                }
            }, project.getDisposed());
        }
    };
    startComputingSourcePosition(value, navigatable);
}
Also used : XNavigatable(com.intellij.xdebugger.frame.XNavigatable) XValueNodeImpl(com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl) AppUIUtil(com.intellij.ui.AppUIUtil) XValue(com.intellij.xdebugger.frame.XValue) DialogWrapper(com.intellij.openapi.ui.DialogWrapper) XDebuggerEvaluationDialog(com.intellij.xdebugger.impl.evaluate.XDebuggerEvaluationDialog) AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) Project(com.intellij.openapi.project.Project) Registry(com.intellij.openapi.util.registry.Registry) NotNull(org.jetbrains.annotations.NotNull) Project(com.intellij.openapi.project.Project) XNavigatable(com.intellij.xdebugger.frame.XNavigatable) XDebuggerEvaluationDialog(com.intellij.xdebugger.impl.evaluate.XDebuggerEvaluationDialog) XValue(com.intellij.xdebugger.frame.XValue)

Aggregations

XDebuggerEvaluationDialog (com.intellij.xdebugger.impl.evaluate.XDebuggerEvaluationDialog)2 Language (com.intellij.lang.Language)1 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)1 Project (com.intellij.openapi.project.Project)1 DialogWrapper (com.intellij.openapi.ui.DialogWrapper)1 Registry (com.intellij.openapi.util.registry.Registry)1 AppUIUtil (com.intellij.ui.AppUIUtil)1 XSourcePosition (com.intellij.xdebugger.XSourcePosition)1 XNavigatable (com.intellij.xdebugger.frame.XNavigatable)1 XValue (com.intellij.xdebugger.frame.XValue)1 XExpressionImpl (com.intellij.xdebugger.impl.breakpoints.XExpressionImpl)1 XValueNodeImpl (com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl)1 NotNull (org.jetbrains.annotations.NotNull)1