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

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

Issue 1737693004: Update SOURCE_KIND when a missing source file appears (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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: 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 4847d9ac4511ee95cba9cbb58b97443c0a7f0277..ed2f8da145f5e1d2adb5137a77e89ca485faa418 100644
--- a/pkg/analyzer/lib/src/generated/source_io.dart
+++ b/pkg/analyzer/lib/src/generated/source_io.dart
@@ -494,54 +494,3 @@ class PackageUriResolver extends UriResolver {
*/
static bool isPackageUri(Uri uri) => PACKAGE_SCHEME == uri.scheme;
}
-
-/**
- * Instances of the class `RelativeFileUriResolver` resolve `file` URI's.
- */
-class RelativeFileUriResolver extends UriResolver {
Brian Wilkerson 2016/02/26 15:07:32 Removing this class is technically a breaking chan
- /**
- * The name of the `file` scheme.
- */
- static String FILE_SCHEME = "file";
-
- /**
- * The directories for the relatvie URI's
- */
- final List<JavaFile> _relativeDirectories;
-
- /**
- * The root directory for all the source trees
- */
- final JavaFile _rootDirectory;
-
- /**
- * Initialize a newly created resolver to resolve `file` URI's relative to the given root
- * directory.
- */
- RelativeFileUriResolver(this._rootDirectory, this._relativeDirectories)
- : super();
-
- @override
- Source resolveAbsolute(Uri uri, [Uri actualUri]) {
- String rootPath = _rootDirectory.toURI().path;
- String uriPath = uri.path;
- if (uriPath != null && uriPath.startsWith(rootPath)) {
- String filePath = uri.path.substring(rootPath.length);
- for (JavaFile dir in _relativeDirectories) {
- JavaFile file = new JavaFile.relative(dir, filePath);
- if (file.exists()) {
- return new FileBasedSource(file, actualUri != null ? actualUri : uri);
- }
- }
- }
- return null;
- }
-
- /**
- * Return `true` if the given URI is a `file` URI.
- *
- * @param uri the URI being tested
- * @return `true` if the given URI is a `file` URI
- */
- static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME;
-}

Powered by Google App Engine
This is Rietveld 408576698