anchor.diff:      _partToLibraries.clear();
       _subtypedNameToFiles.clear();
     }
  +
  +  FileState _newFile(File resource, String path, Uri uri) {
  +    FileSource uriSource = FileSource(resource, uri);
  +    WorkspacePackage? workspacePackage = _workspace?.findPackageFor(path);
  +    FeatureSet featureSet = contextFeatureSet(path, uri, workspacePackage);
  +    Version packageLanguageVersion =
  +        contextLanguageVersion(path, uri, workspacePackage);
  +    var file = FileState._(this, path, uri, uriSource, workspacePackage,
  +        featureSet, packageLanguageVersion);
  +    _pathToFile[path] = file;
  +    _uriToFile[uri] = file;
  +    knownFilePaths.add(path);
  +    knownFiles.add(file);
  +    fileStamp++;
  +    file.refresh();
  +    return file;
  +  }
   }
   
   @visibleForTesting
  
positive.code:     _clearFiles();
    }
  
    void _addFileWithPath(String path, FileState file) {
      knownFilePaths.add(path);
      knownFiles.add(file);
      fileStamp++;
    }
  
    /// Clear all [FileState] data - all maps from path or URI, etc.
    void _clearFiles() {
      _uriToFile.clear();
  
negative.code:     if (file == null) {
        File resource = _resourceProvider.getFile(path);
        Source fileSource = resource.createSource();
        Uri uri = _sourceFactory.restoreUri(fileSource)!;
        file = _newFile(resource, path, uri);
      }
      return file;
    }
  