ActionCallback (@NotNull Project project) { if (project.isDisposed()) return ActionCallback.DONE; PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project); if (!documentManager.hasEventSystemEnabledUncommittedDocuments()) { return ActionCallback.DONE; } final ActionCallback callback = new ActionCallback(); documentManager.performWhenAllCommitted(callback.createSetDoneRunnable()); return callback; }