Index: lib/src/dependency_graph.dart |
diff --git a/lib/src/dependency_graph.dart b/lib/src/dependency_graph.dart |
index 14dda6285276b43b7cce56f621cb61943caf6fbf..96e4bfaf208f464299eb8745c272c1842baa2e07 100644 |
--- a/lib/src/dependency_graph.dart |
+++ b/lib/src/dependency_graph.dart |
@@ -17,7 +17,8 @@ import 'package:analyzer/src/generated/ast.dart' |
ImportDirective, |
LibraryDirective, |
PartDirective, |
- PartOfDirective; |
+ PartOfDirective, |
+ UriBasedDirective; |
import 'package:analyzer/src/generated/engine.dart' |
show ParseDartTask, AnalysisContext; |
import 'package:analyzer/src/generated/source.dart' show Source, SourceKind; |
@@ -279,11 +280,13 @@ class DartSourceNode extends SourceNode { |
if (d is PartOfDirective) return; |
if (d is LibraryDirective) continue; |
+ var directiveUri = (d as UriBasedDirective).uri; |
+ |
// `dart:core` and other similar URLs only contain a name, but it is |
// meant to be a folder when resolving relative paths from it. |
var targetUri = uri.scheme == 'dart' && uri.pathSegments.length == 1 |
- ? Uri.parse('$uri/').resolve(d.uri.stringValue) |
- : uri.resolve(d.uri.stringValue); |
+ ? Uri.parse('$uri/').resolve(directiveUri.stringValue) |
+ : uri.resolve(directiveUri.stringValue); |
var target = |
ParseDartTask.resolveDirective(graph._context, _source, d, null); |
if (target != null) { |