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

Unified Diff: packages/analyzer/lib/src/generated/source_io.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
Index: packages/analyzer/lib/src/generated/source_io.dart
diff --git a/analyzer/lib/src/generated/source_io.dart b/packages/analyzer/lib/src/generated/source_io.dart
similarity index 95%
rename from analyzer/lib/src/generated/source_io.dart
rename to packages/analyzer/lib/src/generated/source_io.dart
index 9c40d7461b4666ffb553a8b69545968bc2b0ee28..4708aa0b97a905835f80482b8caae8182ceb9a38 100644
--- a/analyzer/lib/src/generated/source_io.dart
+++ b/packages/analyzer/lib/src/generated/source_io.dart
@@ -2,9 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
library engine.source.io;
import 'dart:collection';
@@ -276,21 +273,19 @@ 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
Uri restoreAbsolute(Source source) {
- if (source is FileBasedSource) {
- return new Uri.file(source.fullName);
- }
- return null;
+ return new Uri.file(source.fullName);
}
-
+
/**
* Return `true` if the given URI is a `file` URI.
*
@@ -420,12 +415,14 @@ class PackageUriResolver extends UriResolver {
new CaughtException(exception, stackTrace));
}
}
- return new JavaFile.relative(pkgDir, relPath.replaceAll(
- '/', new String.fromCharCode(JavaFile.separatorChar)));
+ return new JavaFile.relative(
+ pkgDir,
+ relPath.replaceAll(
+ '/', new String.fromCharCode(JavaFile.separatorChar)));
}
@override
- Source resolveAbsolute(Uri uri) {
+ Source resolveAbsolute(Uri uri, [Uri actualUri]) {
if (!isPackageUri(uri)) {
return null;
}
@@ -459,11 +456,13 @@ class PackageUriResolver extends UriResolver {
if (_isSelfReference(packagesDirectory, canonicalFile)) {
uri = canonicalFile.toURI();
}
- return new FileBasedSource(canonicalFile, uri);
+ return new FileBasedSource(
+ canonicalFile, actualUri != null ? actualUri : uri);
}
}
return new FileBasedSource(
- getCanonicalFile(_packagesDirectories[0], pkgName, relPath), uri);
+ getCanonicalFile(_packagesDirectories[0], pkgName, relPath),
+ actualUri != null ? actualUri : uri);
}
@override
@@ -537,7 +536,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 +544,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 | « packages/analyzer/lib/src/generated/source.dart ('k') | packages/analyzer/lib/src/generated/static_type_analyzer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698