diff --git a/pkg/analyzer/CHANGELOG.md b/pkg/analyzer/CHANGELOG.md index 53c571346c4..46c6b94e6b9 100644 --- a/pkg/analyzer/CHANGELOG.md +++ b/pkg/analyzer/CHANGELOG.md @@ -1,6 +1,7 @@ ## 1.4.0-dev * Deprecated `TypeProvider.nonSubtypableClasses`. Use `TypeProvider.isNonSubtypableClass` instead. +* Added `sdkPath` to `AnalysisContextCollection` constructor. ## 1.3.0 * Added `Expression.inConstantContext` to API. diff --git a/pkg/analyzer/lib/dart/analysis/analysis_context_collection.dart b/pkg/analyzer/lib/dart/analysis/analysis_context_collection.dart index 1f95fa78b4c..fa03a7c64cf 100644 --- a/pkg/analyzer/lib/dart/analysis/analysis_context_collection.dart +++ b/pkg/analyzer/lib/dart/analysis/analysis_context_collection.dart @@ -17,10 +17,15 @@ abstract class AnalysisContextCollection { /// /// If a [resourceProvider] is given, then it will be used to access the file /// system, otherwise the default resource provider will be used. - factory AnalysisContextCollection( - {required List includedPaths, - List? excludedPaths, - ResourceProvider? resourceProvider}) = AnalysisContextCollectionImpl; + /// + /// If [sdkPath] is given, then Dart SDK at this path will be used, otherwise + /// the default Dart SDK will be used. + factory AnalysisContextCollection({ + required List includedPaths, + List? excludedPaths, + ResourceProvider? resourceProvider, + String? sdkPath, + }) = AnalysisContextCollectionImpl; /// Return all of the analysis contexts in this collection. List get contexts;