use of com.intellij.debugger.engine.managerThread.SuspendContextCommand in project intellij-community by JetBrains.
the class BatchEvaluator method invoke.
public void invoke(ToStringCommand command) {
LOG.assertTrue(DebuggerManager.getInstance(myDebugProcess.getProject()).isDebuggerManagerThread());
final EvaluationContext evaluationContext = command.getEvaluationContext();
final SuspendContext suspendContext = evaluationContext.getSuspendContext();
if (!Registry.is("debugger.batch.evaluation") || !hasBatchEvaluator(evaluationContext)) {
myDebugProcess.getManagerThread().invokeCommand(command);
} else {
List<ToStringCommand> toStringCommands = myBuffer.get(suspendContext);
if (toStringCommands == null) {
final List<ToStringCommand> commands = new ArrayList<>();
toStringCommands = commands;
myBuffer.put(suspendContext, commands);
myDebugProcess.getManagerThread().invokeCommand(new SuspendContextCommand() {
public SuspendContext getSuspendContext() {
return suspendContext;
}
public void action() {
myBuffer.remove(suspendContext);
if (!doEvaluateBatch(commands, evaluationContext)) {
commands.forEach(ToStringCommand::action);
}
}
public void commandCancelled() {
myBuffer.remove(suspendContext);
}
});
}
toStringCommands.add(command);
}
}
use of com.intellij.debugger.engine.managerThread.SuspendContextCommand in project intellij-community by JetBrains.
the class DebuggerManagerThreadImpl method invokeCommand.
@Override
public void invokeCommand(final DebuggerCommand command) {
if (command instanceof SuspendContextCommand) {
SuspendContextCommand suspendContextCommand = (SuspendContextCommand) command;
schedule(new SuspendContextCommandImpl((SuspendContextImpl) suspendContextCommand.getSuspendContext()) {
@Override
public void contextAction() throws Exception {
command.action();
}
@Override
protected void commandCancelled() {
command.commandCancelled();
}
});
} else {
schedule(new DebuggerCommandImpl() {
@Override
protected void action() throws Exception {
command.action();
}
@Override
protected void commandCancelled() {
command.commandCancelled();
}
});
}
}
use of com.intellij.debugger.engine.managerThread.SuspendContextCommand in project intellij-community by JetBrains.
the class ShowAllAs method actionPerformed.
public void actionPerformed(AnActionEvent e) {
DebuggerTreeNodeImpl selectedNode = (DebuggerTreeNodeImpl) ((DebuggerUtilsEx) DebuggerUtils.getInstance()).getSelectedNode(e.getDataContext());
if (selectedNode == null)
return;
if (!isPrimitiveArray(selectedNode))
return;
final DebuggerContext debuggerContext = DebuggerUtils.getInstance().getDebuggerContext(e.getDataContext());
if (debuggerContext == null || debuggerContext.getDebugProcess() == null)
return;
for (Enumeration children = selectedNode.children(); children.hasMoreElements(); ) {
final DebuggerTreeNode child = (DebuggerTreeNode) children.nextElement();
if (child.getDescriptor() instanceof ValueDescriptor) {
debuggerContext.getDebugProcess().getManagerThread().invokeCommand(new SuspendContextCommand() {
public SuspendContext getSuspendContext() {
return debuggerContext.getSuspendContext();
}
public void action() {
child.setRenderer(myRenderer);
}
public void commandCancelled() {
}
});
}
}
}
Aggregations