anchor.diff:              });
             }
           }
  -      }
  -
  -      await changeBuilder.addFileEdit(libraryElement.source.fullName,
  -          (builder) {
  +        if (result.path == libraryPath) {
  +          definingUnitResult = result;
  +        }
  +      }
  +
  +      await changeBuilder.addFileEdit(definingUnitResult.path, (builder) {
           final String oldDir = pathContext.dirname(oldFile);
           final String newDir = pathContext.dirname(newFile);
  -        _updateUriReferences(builder, libraryElement.imports, oldDir, newDir);
  -        _updateUriReferences(builder, libraryElement.exports, oldDir, newDir);
  -        _updateUriReferences(builder, libraryElement.parts, oldDir, newDir);
  +        for (var directive in definingUnitResult.unit.directives) {
  +          if (directive is UriBasedDirective) {
  +            _updateUriReference(builder, directive, oldDir, newDir);
  +          }
  +        }
         });
       } else {
         // Otherwise, we need to update any relative part-of references.
  
positive.code: 
    @override
    Future<SourceChange> createChange() async {
      final DartChangeBuilder changeBuilder =
          new DartChangeBuilder(driver.currentSession);
      final CompilationUnitElement element = resolvedUnit.unit.declaredElement;
      if (element == null) {
        return changeBuilder.sourceChange;
      }
      final LibraryElement libraryElement = element.library;
  
      // If this element is a library, update outgoing references inside the file.
      if (element == libraryElement.definingCompilationUnit) {
        // Handle part-of directives in this library
        final ResolvedLibraryResult libraryResult = await driver.currentSession
            .getResolvedLibraryByElement(libraryElement);
        for (ResolvedUnitResult result in libraryResult.units) {
          if (result.isPart) {
            Iterable<PartOfDirective> partOfs = result.unit.directives
  
negative.code:     return true;
    }
  
    void _updateUriReference(FileEditBuilder builder, UriBasedDirective directive,
        String oldDir, String newDir) {
      var uriNode = directive.uri;
      var uriValue = uriNode.stringValue;
      if (_isRelativeUri(uriValue)) {
        String elementPath = pathContext.join(oldDir, uriValue);
        String newUri = _getRelativeUri(elementPath, newDir);
        builder.addSimpleReplacement(range.node(uriNode), "'$newUri'");
      }
    }
  }
  