mirror of
https://github.com/dart-lang/sdk
synced 2024-09-06 00:59:09 +00:00
Allow analysis_server/ access not yet imported libraries from src/ in analyzer/.
Change-Id: I0b4119965bdb83149117a02f885fe8362f69915f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296502 Commit-Queue: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
parent
9814aaf662
commit
493f36690f
|
@ -59,6 +59,7 @@ class _PackageNameFilter implements FileStateFilter {
|
|||
class _PubFilter implements FileStateFilter {
|
||||
final PubWorkspacePackage targetPackage;
|
||||
final String? targetPackageName;
|
||||
final bool targetPackageIsAnalysisServer;
|
||||
final bool targetInLib;
|
||||
final Set<String> dependencies;
|
||||
|
||||
|
@ -77,9 +78,12 @@ class _PubFilter implements FileStateFilter {
|
|||
}
|
||||
}
|
||||
|
||||
var packageName = pubspec?.name?.value.text;
|
||||
|
||||
return _PubFilter._(
|
||||
targetPackage: package,
|
||||
targetPackageName: pubspec?.name?.value.text,
|
||||
targetPackageName: packageName,
|
||||
targetPackageIsAnalysisServer: packageName == 'analysis_server',
|
||||
targetInLib: inLib,
|
||||
dependencies: dependencies,
|
||||
);
|
||||
|
@ -88,6 +92,7 @@ class _PubFilter implements FileStateFilter {
|
|||
_PubFilter._({
|
||||
required this.targetPackage,
|
||||
required this.targetPackageName,
|
||||
required this.targetPackageIsAnalysisServer,
|
||||
required this.targetInLib,
|
||||
required this.dependencies,
|
||||
});
|
||||
|
@ -119,6 +124,10 @@ class _PubFilter implements FileStateFilter {
|
|||
|
||||
// If not the same package, must be public.
|
||||
if (uri.isSrc) {
|
||||
// Special case `analysis_server` access to `analyzer`.
|
||||
if (targetPackageIsAnalysisServer && packageName == 'analyzer') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue