public static void markPsiFileForUndo(final @NotNull PsiFile file) {
    Project project = file.getProject();
    final Document document = PsiDocumentManager.getInstance(project).getDocument(file);
    if (document == null) return;
    CommandProcessor.getInstance().addAffectedDocuments(project, document);
  }
public static void markPsiFileForUndo(final @NotNull PsiFile file)