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

Unified Diff: packages/analyzer/lib/file_system/file_system.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 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 | « packages/analyzer/lib/analyzer.dart ('k') | packages/analyzer/lib/file_system/memory_file_system.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/analyzer/lib/file_system/file_system.dart
diff --git a/analyzer/lib/file_system/file_system.dart b/packages/analyzer/lib/file_system/file_system.dart
similarity index 95%
rename from analyzer/lib/file_system/file_system.dart
rename to packages/analyzer/lib/file_system/file_system.dart
index 899d6c5bf6227ad7b2ff4b2e8f349f96e0913e88..7d3ed95ad2988a45c3f4869e092b71b112056918 100644
--- a/analyzer/lib/file_system/file_system.dart
+++ b/packages/analyzer/lib/file_system/file_system.dart
@@ -140,14 +140,14 @@ abstract class ResourceProvider {
/**
* Return a [File] that corresponds to the given [path].
- *
+ *
* A file may or may not exist at this location.
*/
File getFile(String path);
/**
* Return a [Folder] that corresponds to the given [path].
- *
+ *
* A folder may or may not exist at this location.
*/
Folder getFolder(String path);
@@ -181,20 +181,21 @@ class ResourceUriResolver extends UriResolver {
ResourceUriResolver(this._provider);
@override
- Source resolveAbsolute(Uri uri) {
+ Source resolveAbsolute(Uri uri, [Uri actualUri]) {
if (!_isFileUri(uri)) {
return null;
}
Resource resource =
_provider.getResource(_provider.pathContext.fromUri(uri));
if (resource is File) {
- return resource.createSource(uri);
+ return resource.createSource(actualUri != null ? actualUri : uri);
}
return null;
}
@override
- Uri restoreAbsolute(Source source) => source.uri;
+ Uri restoreAbsolute(Source source) =>
+ _provider.pathContext.toUri(source.fullName);
/**
* Return `true` if the given [uri] is a `file` URI.
« no previous file with comments | « packages/analyzer/lib/analyzer.dart ('k') | packages/analyzer/lib/file_system/memory_file_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698