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:     return true;
    }
  
    void _updateUriReference(DartFileEditBuilder builder,
        UriReferencedElement element, String oldDir, String newDir) {
      if (!element.isSynthetic) {
        String elementUri = element.uri;
        if (_isRelativeUri(elementUri)) {
          String elementPath = pathContext.join(oldDir, elementUri);
          String newUri = _getRelativeUri(elementPath, newDir);
          int uriOffset = element.uriOffset;
          int uriLength = element.uriEnd - uriOffset;
          builder.addSimpleReplacement(
              new SourceRange(uriOffset, uriLength), "'$newUri'");
        }
      }
    }
  
    void _updateUriReferences(DartFileEditBuilder builder,
        List<UriReferencedElement> elements, String oldDir, String newDir) {
      for (UriReferencedElement element in elements) {
        _updateUriReference(builder, element, oldDir, newDir);
      }
    }
  }
  
negative.code: import 'package:analyzer/file_system/file_system.dart';
  import 'package:analyzer/src/dart/analysis/driver.dart';
  import 'package:analyzer/src/generated/source.dart';
  import 'package:analyzer_plugin/utilities/change_builder/change_builder_core.dart';
  import 'package:analyzer_plugin/utilities/range_factory.dart';
  import 'package:path/path.dart' as pathos;
  
  /**
  