| 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 858fd0636a60235d799a0f331834c973c7a6e256..c7488b2b615c3db10d8241c9f38810a39c83fd2d 100644
|
| --- a/pkg/analyzer/lib/src/context/context.dart
|
| +++ b/pkg/analyzer/lib/src/context/context.dart
|
| @@ -644,6 +644,14 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
| }
|
|
|
| @override
|
| + AnalysisTarget canonicalizeTarget(AnalysisTarget target) {
|
| + if (target is LibrarySpecificUnit) {
|
| + return getLibrarySpecificUnit(target.library, target.unit);
|
| + }
|
| + return target;
|
| + }
|
| +
|
| + @override
|
| String computeDocumentationComment(Element element) =>
|
| element?.documentationComment;
|
|
|
| @@ -856,6 +864,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
| CacheEntry getCacheEntry(AnalysisTarget target) {
|
| CacheEntry entry = _cache.get(target);
|
| if (entry == null) {
|
| + target = canonicalizeTarget(target);
|
| entry = new CacheEntry(target);
|
| ImplicitAnalysisEvent event = null;
|
| if (target is Source) {
|
| @@ -1007,6 +1016,22 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
| getResult(source, LIBRARY_ELEMENT);
|
|
|
| @override
|
| + LibrarySpecificUnit getLibrarySpecificUnit(Source library, Source unit) {
|
| + CacheEntry entry = analysisCache.get(unit);
|
| + if (entry != null) {
|
| + LibrarySpecificUnit lsu = entry.librarySpecificUnit;
|
| + if (lsu == null) {
|
| + lsu = new LibrarySpecificUnit(library, unit);
|
| + entry.librarySpecificUnit = lsu;
|
| + return lsu;
|
| + } else if (lsu.library == library && lsu.unit == unit) {
|
| + return lsu;
|
| + }
|
| + }
|
| + return new LibrarySpecificUnit(library, unit);
|
| + }
|
| +
|
| + @override
|
| LineInfo getLineInfo(Source source) => getResult(source, LINE_INFO);
|
|
|
| @override
|
|
|