Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2364)

Unified Diff: pkg/analyzer/lib/src/generated/source_io.dart

Issue 1245263002: Actual URI support for package URI resolution. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge master (tk2). Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/source.dart ('k') | pkg/analyzer/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/source_io.dart
diff --git a/pkg/analyzer/lib/src/generated/source_io.dart b/pkg/analyzer/lib/src/generated/source_io.dart
index 9c40d7461b4666ffb553a8b69545968bc2b0ee28..33320a8c800b13abdb0a39b0217c3ceb59378e4e 100644
--- a/pkg/analyzer/lib/src/generated/source_io.dart
+++ b/pkg/analyzer/lib/src/generated/source_io.dart
@@ -276,11 +276,12 @@ class FileUriResolver extends UriResolver {
static String FILE_SCHEME = "file";
@override
- Source resolveAbsolute(Uri uri) {
+ Source resolveAbsolute(Uri uri, [Uri actualUri]) {
if (!isFileUri(uri)) {
return null;
}
- return new FileBasedSource(new JavaFile.fromUri(uri), uri);
+ return new FileBasedSource(
+ new JavaFile.fromUri(uri), actualUri != null ? actualUri : uri);
}
@override
@@ -290,7 +291,7 @@ class FileUriResolver extends UriResolver {
}
return null;
}
-
+
/**
* Return `true` if the given URI is a `file` URI.
*
@@ -425,7 +426,7 @@ class PackageUriResolver extends UriResolver {
}
@override
- Source resolveAbsolute(Uri uri) {
+ Source resolveAbsolute(Uri uri, [Uri actualUri]) {
if (!isPackageUri(uri)) {
return null;
}
@@ -463,7 +464,8 @@ class PackageUriResolver extends UriResolver {
}
}
return new FileBasedSource(
- getCanonicalFile(_packagesDirectories[0], pkgName, relPath), uri);
+ getCanonicalFile(_packagesDirectories[0], pkgName, relPath),
+ actualUri != null ? actualUri : uri);
}
@override
@@ -537,7 +539,7 @@ class RelativeFileUriResolver extends UriResolver {
: super();
@override
- Source resolveAbsolute(Uri uri) {
+ Source resolveAbsolute(Uri uri, [Uri actualUri]) {
String rootPath = _rootDirectory.toURI().path;
String uriPath = uri.path;
if (uriPath != null && uriPath.startsWith(rootPath)) {
@@ -545,7 +547,7 @@ class RelativeFileUriResolver extends UriResolver {
for (JavaFile dir in _relativeDirectories) {
JavaFile file = new JavaFile.relative(dir, filePath);
if (file.exists()) {
- return new FileBasedSource(file, uri);
+ return new FileBasedSource(file, actualUri != null ? actualUri : uri);
}
}
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/source.dart ('k') | pkg/analyzer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698