| Index: pkg/analyzer/lib/src/context/context.dart
|
| diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart
|
| index dc01ee1ea0c098b167d311f42521d1b450e68497..7054910d2b3eefa4d22966123d17ffc604fae0ff 100644
|
| --- a/pkg/analyzer/lib/src/context/context.dart
|
| +++ b/pkg/analyzer/lib/src/context/context.dart
|
| @@ -885,6 +885,16 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
| }
|
|
|
| @override
|
| + ChangeNoticeImpl getNotice(Source source) {
|
| + ChangeNoticeImpl notice = _pendingNotices[source];
|
| + if (notice == null) {
|
| + notice = new ChangeNoticeImpl(source);
|
| + _pendingNotices[source] = notice;
|
| + }
|
| + return notice;
|
| + }
|
| +
|
| + @override
|
| Namespace getPublicNamespace(LibraryElement library) {
|
| // TODO(brianwilkerson) Rename this to not start with 'get'.
|
| // Note that this is not part of the API of the interface.
|
| @@ -1396,16 +1406,6 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
| return notices;
|
| }
|
|
|
| - @override
|
| - ChangeNoticeImpl getNotice(Source source) {
|
| - ChangeNoticeImpl notice = _pendingNotices[source];
|
| - if (notice == null) {
|
| - notice = new ChangeNoticeImpl(source);
|
| - _pendingNotices[source] = notice;
|
| - }
|
| - return notice;
|
| - }
|
| -
|
| /**
|
| * Return a list containing all of the sources known to this context that have
|
| * the given [kind].
|
| @@ -1970,6 +1970,26 @@ class PendingFuture<T> {
|
| }
|
|
|
| /**
|
| + * An [AnalysisContext] that only contains sources for a Dart SDK.
|
| + */
|
| +class SdkAnalysisContext extends AnalysisContextImpl {
|
| + @override
|
| + AnalysisCache createCacheFromSourceFactory(SourceFactory factory) {
|
| + if (factory == null) {
|
| + return super.createCacheFromSourceFactory(factory);
|
| + }
|
| + DartSdk sdk = factory.dartSdk;
|
| + if (sdk == null) {
|
| + throw new IllegalArgumentException(
|
| + "The source factory for an SDK analysis context must have a DartUriResolver");
|
| + }
|
| + return new AnalysisCache(<CachePartition>[
|
| + AnalysisEngine.instance.partitionManager_new.forSdk(sdk)
|
| + ]);
|
| + }
|
| +}
|
| +
|
| +/**
|
| * A helper class used to create futures for AnalysisContextImpl. Using a helper
|
| * class allows us to preserve the generic parameter T.
|
| */
|
|
|