Promise<List<SmartStepTarget>> (SourcePosition position, DebuggerSession session, boolean smart) { var res = new AsyncPromise<List<SmartStepTarget>>(); session.getProcess().getManagerThread().schedule(new DebuggerContextCommandImpl(session.getContextManager().getContext()) { @Override public void threadAction(@NotNull SuspendContextImpl suspendContext) { Promises.compute(res, () -> ReadAction.nonBlocking(() -> findStepTargets(position, suspendContext, getDebuggerContext(), smart)).executeSynchronously()); } @Override protected void commandCancelled() { res.setError("Cancelled"); } @Override public Priority getPriority() { return Priority.NORMAL; } }); return res; }