Promise<Object> (@NotNull PlaybackContext context) { AsyncPromise<Object> promise = new AsyncPromise<>(); ApplicationManager.getApplication().invokeLater(() -> { Promises.compute(promise, () -> { computePromise(s -> context.message(s, getLine()), context.getProject()); return null; }); }); return promise; }