void (@NotNull Computable<Runnable> readAction) { final Runnable[] writeAction = new Runnable[1]; runWithProgress(() -> ApplicationManager.getApplication().runReadAction(() -> { writeAction[0] = readAction.compute(); })); if (writeAction[0] != null) { WriteCommandAction.writeCommandAction(myProject).withName(title).run(() -> { writeAction[0].run(); }); } }