Index: pkg/front_end/lib/src/fasta/translate_uri.dart |
diff --git a/pkg/front_end/lib/src/fasta/translate_uri.dart b/pkg/front_end/lib/src/fasta/translate_uri.dart |
index 00453c669298d2b26cea22d5a79f55a7018cfdff..3799df8a949c67d37e7c112300d35b16950a217e 100644 |
--- a/pkg/front_end/lib/src/fasta/translate_uri.dart |
+++ b/pkg/front_end/lib/src/fasta/translate_uri.dart |
@@ -23,7 +23,18 @@ class TranslateUri { |
return null; |
} |
- Uri translateDartUri(Uri uri) => dartLibraries[uri.path]; |
+ Uri translateDartUri(Uri uri) { |
+ if (!uri.isScheme('dart')) return null; |
+ String path = uri.path; |
+ |
+ int index = path.indexOf('/'); |
+ if (index == -1) return dartLibraries[path]; |
+ |
+ String libraryName = path.substring(0, index); |
+ String relativePath = path.substring(index + 1); |
+ Uri libraryFileUri = dartLibraries[libraryName]; |
+ return libraryFileUri?.resolve(relativePath); |
+ } |
Uri translatePackageUri(Uri uri) { |
int index = uri.path.indexOf("/"); |