Index: pkg/analysis_server/lib/src/context_manager.dart |
diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart |
index 86b13a101c120425708e6795a0a7d54a5e83ce34..fd35213fc99a8963a0232387f8e2dd7d3d4b8de6 100644 |
--- a/pkg/analysis_server/lib/src/context_manager.dart |
+++ b/pkg/analysis_server/lib/src/context_manager.dart |
@@ -1710,6 +1710,10 @@ class CustomPackageResolverDisposition extends FolderDisposition { |
@override |
EmbedderYamlLocator getEmbedderLocator(ResourceProvider resourceProvider) => |
new EmbedderYamlLocator(null); |
+ |
+ @override |
+ SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) => |
+ new SdkExtensionFinder(null); |
} |
/** |
@@ -1757,6 +1761,13 @@ abstract class FolderDisposition { |
* where that is necessary. |
*/ |
EmbedderYamlLocator getEmbedderLocator(ResourceProvider resourceProvider); |
+ |
+ /** |
+ * Return the extension finder used to locate the `_sdkext` file used to add |
+ * extensions to the SDK. The [resourceProvider] is used to access the file |
+ * system in cases where that is necessary. |
+ */ |
+ SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider); |
} |
/** |
@@ -1780,6 +1791,10 @@ class NoPackageFolderDisposition extends FolderDisposition { |
@override |
EmbedderYamlLocator getEmbedderLocator(ResourceProvider resourceProvider) => |
new EmbedderYamlLocator(null); |
+ |
+ @override |
+ SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) => |
+ new SdkExtensionFinder(null); |
} |
/** |
@@ -1790,6 +1805,7 @@ class PackageMapDisposition extends FolderDisposition { |
final Map<String, List<Folder>> packageMap; |
EmbedderYamlLocator _embedderLocator; |
+ SdkExtensionFinder _sdkExtensionFinder; |
@override |
final String packageRoot; |
@@ -1814,6 +1830,11 @@ class PackageMapDisposition extends FolderDisposition { |
} |
return _embedderLocator; |
} |
+ |
+ @override |
+ SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) { |
+ return _sdkExtensionFinder ??= new SdkExtensionFinder(packageMap); |
+ } |
} |
/** |
@@ -1827,6 +1848,7 @@ class PackagesFileDisposition extends FolderDisposition { |
Map<String, List<Folder>> packageMap; |
EmbedderYamlLocator _embedderLocator; |
+ SdkExtensionFinder _sdkExtensionFinder; |
PackagesFileDisposition(this.packages); |
@@ -1868,4 +1890,10 @@ class PackagesFileDisposition extends FolderDisposition { |
} |
return _embedderLocator; |
} |
+ |
+ @override |
+ SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) { |
+ return _sdkExtensionFinder ??= |
+ new SdkExtensionFinder(buildPackageMap(resourceProvider)); |
+ } |
} |