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

Unified Diff: pkg/analyzer/lib/src/context/builder.dart

Issue 2719703005: fix dartanalyzer find options in bazel workspace (Closed)
Patch Set: merge Created 3 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
« no previous file with comments | « no previous file | pkg/analyzer_cli/lib/src/driver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/context/builder.dart
diff --git a/pkg/analyzer/lib/src/context/builder.dart b/pkg/analyzer/lib/src/context/builder.dart
index 05421729840a748034c0dfa91208f933c66ed52c..ea35756ee2f1f635e97ae7156921bda2acd83d18 100644
--- a/pkg/analyzer/lib/src/context/builder.dart
+++ b/pkg/analyzer/lib/src/context/builder.dart
@@ -722,8 +722,7 @@ class _BasicWorkspace extends Workspace {
final ResourceProvider provider;
/**
- * The absolute workspace root path (the directory containing the `.jiri_root`
- * directory).
+ * The absolute workspace root path.
*/
final String root;
@@ -769,7 +768,15 @@ class _BasicWorkspace extends Workspace {
* Find the basic workspace that contains the given [path].
*/
static _BasicWorkspace find(
- ResourceProvider resourceProvider, String path, ContextBuilder builder) {
- return new _BasicWorkspace._(resourceProvider, path, builder);
+ ResourceProvider provider, String path, ContextBuilder builder) {
+ Context context = provider.pathContext;
+
+ // Ensure that the path is absolute and normalized.
+ if (!context.isAbsolute(path)) {
+ throw new ArgumentError('not absolute: $path');
+ }
+ path = context.normalize(path);
+
+ return new _BasicWorkspace._(provider, path, builder);
}
}
« no previous file with comments | « no previous file | pkg/analyzer_cli/lib/src/driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698