boolean (@NotNull Document document) { assert !isCommitInProgress() : "Do not call commitDocument() from inside PSI change listener"; // otherwise there are many clients calling commitAllDocs() on PSI childrenChanged() if (getSynchronizer().isDocumentAffectedByTransactions(document)) return false; PsiFile psiFile = getPsiFile(document); if (psiFile == null) { myUncommittedDocuments.remove(document); runAfterCommitActions(document); return true; // the project must be closing or file deleted } if (ApplicationManager.getApplication().isDispatchThread()) { ApplicationManager.getApplication().runWriteAction(() -> doCommit(document, psiFile)); } else { doCommit(document, psiFile); } return true; }