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

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

Issue 679763002: Add package root support to analysis server. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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: 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 a5b4347d78c0bac7bca553dceba28e2b289a6c0c..08c3b6ae9d225ac970234a3313d067543025df3c 100644
--- a/pkg/analyzer/lib/src/generated/source_io.dart
+++ b/pkg/analyzer/lib/src/generated/source_io.dart
@@ -345,6 +345,18 @@ class PackageUriResolver extends UriResolver {
}
}
+ /**
+ * If the list of package directories contains one element, return it.
+ * Otherwise raise an exception. Intended for testing.
+ */
+ String get packagesDirectory_forTesting {
+ int length = _packagesDirectories.length;
+ if (length != 1) {
+ throw new Exception('Expected 1 package directory, found $length');
+ }
+ return _packagesDirectories[0].getPath();
+ }
+
@override
Source resolveAbsolute(Uri uri) {
if (!isPackageUri(uri)) {

Powered by Google App Engine
This is Rietveld 408576698