@Override
  @Nullable
  protected PsiFile getPsiFile(@NotNull Project project, @NotNull Editor editor) {
    final Document document = editor.getDocument();
    final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project);
    documentManager.commitDocument(document);
    return getRoot(documentManager.getPsiFile(document), editor);
  }
@Override
  @Nullable
  protected PsiFile getPsiFile(@NotNull Project project, @NotNull Editor editor)