Promise<Object> (@NotNull PlaybackContext context) { ActionCallback myActionCallback = new ActionCallbackProfilerStopper(); ReformatCodeProcessor codeProcessor = new ReformatCodeProcessor(context.getProject(), false); codeProcessor.setPostRunnable(() -> { context.message(PerformanceTestingBundle.message("command.reformat.finish"), getLine()); myActionCallback.setDone(); }); ApplicationManager.getApplication().invokeLater(() -> codeProcessor.run()); return Promises.toPromise(myActionCallback); }