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

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

Issue 2771323002: Fix package URI calculation when in third_party but not third_party/dart (Closed)
Patch Set: simplify Created 3 years, 9 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/test/generated/bazel_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ae3c3ec3bb415f744ce0e695f5d9080221fe4b17..89efeef8a08fe70a2aa259d04d00273ec926d56b 100644
--- a/pkg/analyzer/lib/src/generated/bazel.dart
+++ b/pkg/analyzer/lib/src/generated/bazel.dart
@@ -98,14 +98,13 @@ class BazelPackageUriResolver extends UriResolver {
if (root != null && context.isWithin(root, path)) {
String relative = context.relative(path, from: root);
List<String> components = context.split(relative);
- if (components.length >= 1 && components[0] == 'third_party') {
- if (components.length > 4 &&
- components[1] == 'dart' &&
- components[3] == 'lib') {
- String packageName = components[2];
- String pathInLib = components.skip(4).join('/');
- return Uri.parse('package:$packageName/$pathInLib');
- }
+ if (components.length > 4 &&
+ components[0] == 'third_party' &&
+ components[1] == 'dart' &&
+ components[3] == 'lib') {
+ String packageName = components[2];
+ String pathInLib = components.skip(4).join('/');
+ return Uri.parse('package:$packageName/$pathInLib');
} else {
for (int i = 2; i < components.length - 1; i++) {
String component = components[i];
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/bazel_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698