void (@NotNull Project project) { PsiDocumentManagerImpl documentManager = (PsiDocumentManagerImpl)PsiDocumentManager.getInstance(project); documentManager.clearUncommittedDocuments(); ProjectManagerEx projectManager = ProjectManagerEx.getInstanceEx(); if (projectManager.isDefaultProjectInitialized()) { Project defaultProject = projectManager.getDefaultProject(); ((PsiDocumentManagerImpl)PsiDocumentManager.getInstance(defaultProject)).clearUncommittedDocuments(); } }