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