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

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

Issue 2403723002: Add more tests for BazelPackageUriResolver.resolveAbsolute(). (Closed)
Patch Set: Created 4 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/bazel.dart
diff --git a/pkg/analyzer/lib/src/generated/bazel.dart b/pkg/analyzer/lib/src/generated/bazel.dart
index 8d9858f5b48ac6a5f938c8f84463e181196bafe9..ae493a744e270fa34e055f712ee30538e15bfcd8 100644
--- a/pkg/analyzer/lib/src/generated/bazel.dart
+++ b/pkg/analyzer/lib/src/generated/bazel.dart
@@ -73,9 +73,9 @@ class BazelPackageUriResolver extends UriResolver {
String filePath = fileUriPart.replaceAll('/', _context.separator);
if (packageName.indexOf('.') == -1) {
- String path =
- _context.join('third_party', 'dart', packageName, 'lib', filePath);
- File file = _workspace.getFile(path);
+ String path = _context.join(_workspace.root, 'third_party', 'dart',
+ packageName, 'lib', filePath);
+ File file = _workspace.findFile(path);
return file?.createSource(uri);
} else {
String packagePath = packageName.replaceAll('.', _context.separator);
@@ -164,14 +164,6 @@ class BazelWorkspace {
}
/**
- * Return the file for the given [pathInWorkspace]. The file is returned even
- * if it does not exist.
- */
- File getFile(String pathInWorkspace) {
- return provider.getFile(provider.pathContext.join(root, pathInWorkspace));
- }
-
- /**
* Find the Bazel workspace that contains the given [path].
*
* Return `null` if a workspace markers, such as the `WORKSPACE` file, or
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/bazel_test.dart » ('j') | pkg/analyzer/test/generated/bazel_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698