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

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

Issue 1928623002: Fix ExplicitSourceResolver's handling of missing files. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | pkg/analyzer/lib/src/generated/source_io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/source.dart
diff --git a/pkg/analyzer/lib/src/generated/source.dart b/pkg/analyzer/lib/src/generated/source.dart
index 65e8f953af24d826d5aa0e57d648f2480745a3b1..fefdc7fe62da8a23fb9dcf4d1c41927c202c090d 100644
--- a/pkg/analyzer/lib/src/generated/source.dart
+++ b/pkg/analyzer/lib/src/generated/source.dart
@@ -14,7 +14,8 @@ import 'package:analyzer/src/generated/java_core.dart';
import 'package:analyzer/src/generated/java_engine.dart';
import 'package:analyzer/src/generated/java_io.dart' show JavaFile;
import 'package:analyzer/src/generated/sdk.dart' show DartSdk;
-import 'package:analyzer/src/generated/source_io.dart' show FileBasedSource;
+import 'package:analyzer/src/generated/source_io.dart'
+ show FileBasedSource, FileUriResolver, PackageUriResolver;
import 'package:analyzer/task/model.dart';
import 'package:package_config/packages.dart';
import 'package:path/path.dart' as pathos;
@@ -895,6 +896,20 @@ class UriKind extends Enum<UriKind> {
}
return null;
}
+
+ /**
+ * Return the URI kind corresponding to the given scheme string.
+ */
+ static UriKind fromScheme(String scheme) {
+ if (scheme == PackageUriResolver.PACKAGE_SCHEME) {
+ return UriKind.PACKAGE_URI;
+ } else if (scheme == DartUriResolver.DART_SCHEME) {
+ return UriKind.DART_URI;
+ } else if (scheme == FileUriResolver.FILE_SCHEME) {
+ return UriKind.FILE_URI;
+ }
+ return UriKind.FILE_URI;
+ }
}
/**
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/source_io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698