Skip to content

Commit f1a753a

Browse files
scheglovCommit Bot
authored andcommitted
Don't look for .packages while creating Workspace.
Change-Id: I8903f21caad6d0920dc2dca8f2a20137540198b4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237722 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
1 parent 8f563a4 commit f1a753a

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

pkg/analyzer/lib/src/dart/analysis/context_locator.dart

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -380,17 +380,6 @@ class ContextLocatorImpl implements ContextLocator {
380380

381381
var rootPath = folder.path;
382382

383-
// TODO(scheglov) Do we need this?
384-
if (_hasPackageFileInPath(rootPath)) {
385-
// A Bazel or Gn workspace that includes a '.packages' file is treated
386-
// like a normal (non-Bazel/Gn) directory. But may still use
387-
// package:build or Pub.
388-
return PackageBuildWorkspace.find(
389-
resourceProvider, packageMap, rootPath) ??
390-
PubWorkspace.find(resourceProvider, packageMap, rootPath) ??
391-
BasicWorkspace.find(resourceProvider, packageMap, rootPath);
392-
}
393-
394383
Workspace? workspace;
395384
workspace = BazelWorkspace.find(resourceProvider, rootPath,
396385
lookForBuildFileSubstitutes: false);
@@ -522,15 +511,6 @@ class ContextLocatorImpl implements ContextLocator {
522511
return null;
523512
}
524513

525-
/// Return `true` if either the directory at [rootPath] or a parent of that
526-
/// directory contains a `.packages` file.
527-
bool _hasPackageFileInPath(String rootPath) {
528-
var folder = resourceProvider.getFolder(rootPath);
529-
return folder.withAncestors.any((current) {
530-
return current.getChildAssumingFile('.packages').exists;
531-
});
532-
}
533-
534514
/// Add to the given lists of [folders] and [files] all of the resources in
535515
/// the given list of [paths] that exist and are not contained within one of
536516
/// the folders.

0 commit comments

Comments
 (0)