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

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

Issue 1167733004: Decide if unit without directives is a part or a library. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 months 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
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 6d3e6eb23d1f1972f61e12fe20f515cba52b6a22..e988f1c8e0aafac7b01a13259e1430526642d276 100644
--- a/pkg/analyzer/lib/src/task/dart_work_manager.dart
+++ b/pkg/analyzer/lib/src/task/dart_work_manager.dart
@@ -243,10 +243,6 @@ class DartWorkManager implements WorkManager {
return WorkOrderPriority.NONE;
}
- void unitIncrementallyResolved(Source librarySource, Source unitSource) {
- librarySourceQueue.add(librarySource);
- }
-
@override
void resultsComputed(
AnalysisTarget target, Map<ResultDescriptor, dynamic> outputs) {
@@ -267,6 +263,7 @@ class DartWorkManager implements WorkManager {
List<Source> includedParts = outputs[INCLUDED_PARTS];
if (includedParts != null) {
libraryPartsMap[library] = includedParts;
+ // update contanining libraries
for (Source part in includedParts) {
List<Source> libraries =
partLibrariesMap.putIfAbsent(part, () => <Source>[]);
@@ -274,6 +271,19 @@ class DartWorkManager implements WorkManager {
libraries.add(library);
}
}
+ // all of the "includedParts" are not libraries anymore
+ for (Source part in includedParts) {
+ unknownSourceQueue.remove(part);
+ librarySourceQueue.remove(part);
+ analysisCache.remove(new LibrarySpecificUnit(part, part));
+ CacheEntry partEntry = analysisCache.get(part);
+ if (partEntry != null) {
+ partEntry.setValue(SOURCE_KIND, SourceKind.PART, <TargetedResult>[
+ new TargetedResult(part, CONTENT),
+ new TargetedResult(target, CONTENT)
+ ]);
+ }
+ }
}
}
// Update notice.
@@ -309,6 +319,10 @@ class DartWorkManager implements WorkManager {
}
}
+ void unitIncrementallyResolved(Source librarySource, Source unitSource) {
+ librarySourceQueue.add(librarySource);
+ }
+
/**
* Returns `true` if the given [result] of the given [target] needs
* computing, i.e. it is not in the valid and not in the error state.

Powered by Google App Engine
This is Rietveld 408576698