void (@NotNull FileViewProvider viewProvider) { PsiDocumentManager documentManager = PsiDocumentManager.getInstance(myProject); Document document = viewProvider.getDocument(); assert document != null; documentManager.commitDocument(document); }