public @Nullable TextRange getFileDirtyScope(@NotNull Document document, @Nullable PsiFile file, int passId) {
    RangeMarker marker;
    synchronized (myDocumentToStatusMap) {
      FileStatus status = myDocumentToStatusMap.get(document);
      if (status == null) {
        marker = WHOLE_FILE_DIRTY_MARKER;
      }
      else {
        if (status.defensivelyMarked) {
          status.markWholeFileDirty(myProject);
          status.defensivelyMarked = false;
        }
        assertRegisteredPass(passId, status);
        marker = status.dirtyScopes.get(passId);
      }
    }
    if (marker == null) {
      return null;
    }
    if (marker == WHOLE_FILE_DIRTY_MARKER) {
      return file == null ? null : file.getTextRange();
    }
    return marker.isValid() ? marker.getTextRange() : new TextRange(0, document.getTextLength());
  }
public @Nullable TextRange getFileDirtyScope(@NotNull Document document, @Nullable PsiFile file, int passId)