void (@NotNull PsiFile file) { final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(myProject); Document document = documentManager.getDocument(file); if (document != null) { documentManager.commitDocument(document); } }