private void commitFile(@NotNull GroovyFile file) {
    final Document document = PsiDocumentManager.getInstance(myProject).getDocument(file);
    PsiDocumentManager psiDocumentManager = PsiDocumentManager.getInstance(file.getProject());
    LOG.assertTrue(document != null);
    psiDocumentManager.commitDocument(document);
    LOG.assertTrue(file.isValid());
  }
private void commitFile(@NotNull GroovyFile file)