Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(928)

Unified Diff: pkg/analyzer/lib/src/task/dart_work_manager.dart

Issue 1441013003: Issue 24812. Fix for detached CompilationUnitElement(s) after package version switch. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/abstract_context.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/dart_work_manager.dart
diff --git a/pkg/analyzer/lib/src/task/dart_work_manager.dart b/pkg/analyzer/lib/src/task/dart_work_manager.dart
index 62a25ea9a89375d7e89887a7a62a2de744c7a4ba..793d9ce4f22336643f3e0182dac9856dbb0d7ce5 100644
--- a/pkg/analyzer/lib/src/task/dart_work_manager.dart
+++ b/pkg/analyzer/lib/src/task/dart_work_manager.dart
@@ -88,7 +88,8 @@ class DartWorkManager implements WorkManager {
analysisCache.onResultInvalidated.listen((InvalidatedResult event) {
if (event.descriptor == LIBRARY_ERRORS_READY) {
CacheEntry entry = event.entry;
- if (entry.getValue(SOURCE_KIND) == SourceKind.LIBRARY) {
+ if (entry.explicitlyAdded &&
+ entry.getValue(SOURCE_KIND) == SourceKind.LIBRARY) {
librarySourceQueue.add(entry.target);
}
}
@@ -392,7 +393,10 @@ class DartWorkManager implements WorkManager {
unitTargets.add(target);
Source library = target.library;
if (context.exists(library)) {
- librarySourceQueue.add(library);
+ CacheEntry entry = iterator.value;
+ if (entry.explicitlyAdded) {
+ librarySourceQueue.add(library);
+ }
}
}
}
@@ -408,6 +412,8 @@ class DartWorkManager implements WorkManager {
entry.setState(EXPLICITLY_IMPORTED_LIBRARIES, CacheState.INVALID);
entry.setState(EXPORTED_LIBRARIES, CacheState.INVALID);
entry.setState(INCLUDED_PARTS, CacheState.INVALID);
+ entry.setState(LIBRARY_SPECIFIC_UNITS, CacheState.INVALID);
+ entry.setState(UNITS, CacheState.INVALID);
}
}
}
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/abstract_context.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698