| Index: pkg/analysis_server/lib/src/services/refactoring/move_file.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/refactoring/move_file.dart b/pkg/analysis_server/lib/src/services/refactoring/move_file.dart
|
| index b0ee6a66859783d7dec83c6a29f5e3c531044933..e22d79f64bc7af7f2c8f3125b1110e20650437a2 100644
|
| --- a/pkg/analysis_server/lib/src/services/refactoring/move_file.dart
|
| +++ b/pkg/analysis_server/lib/src/services/refactoring/move_file.dart
|
| @@ -98,7 +98,7 @@ class MoveFileRefactoringImpl extends RefactoringImpl implements
|
| void _updateUriReference(UriReferencedElement element) {
|
| if (!element.isSynthetic) {
|
| String elementUri = element.uri;
|
| - if (pathos.isRelative(elementUri)) {
|
| + if (_isRelativeUri(elementUri)) {
|
| String elementPath = pathos.join(oldLibraryDir, elementUri);
|
| String newUri = pathos.relative(elementPath, from: newLibraryDir);
|
| int uriOffset = element.uriOffset;
|
| @@ -115,4 +115,24 @@ class MoveFileRefactoringImpl extends RefactoringImpl implements
|
| _updateUriReference(element);
|
| }
|
| }
|
| +
|
| + /**
|
| + * Checks if the given [path] represents a relative URI.
|
| + *
|
| + * The following URI's are not relative:
|
| + * `/absolute/path/file.dart`
|
| + * `dart:math`
|
| + */
|
| + static bool _isRelativeUri(String path) {
|
| + // absolute path
|
| + if (pathos.isAbsolute(path)) {
|
| + return false;
|
| + }
|
| + // absolute URI
|
| + if (Uri.parse(path).isAbsolute) {
|
| + return false;
|
| + }
|
| + // OK
|
| + return true;
|
| + }
|
| }
|
|
|