private static @Nullable BaseContent createForModifiedDocument(@NotNull Project project, @NotNull VirtualFile file) {
    AbstractVcs vcs = ProjectLevelVcsManager.getInstance(project).getVcsFor(file);
    if (vcs == null) return null;
    DiffProvider diffProvider = vcs.getDiffProvider();
    ChangeProvider cp = vcs.getChangeProvider();
    if (diffProvider == null || cp == null) return null;

    if (!cp.isModifiedDocumentTrackingRequired()) return null;

    ContentRevision beforeRevision = diffProvider.createCurrentFileContent(file);
    if (beforeRevision == null) return null;
    return createBaseContent(project, beforeRevision);
  }
private static @Nullable BaseContent createForModifiedDocument(@NotNull Project project, @NotNull VirtualFile file)