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

Unified Diff: pkg/analysis_server/lib/src/context_manager.dart

Issue 2489523008: Fix disposing context with the new driver. (Closed)
Patch Set: Created 4 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 | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analyzer/lib/src/dart/analysis/driver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/context_manager.dart
diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart
index 04cf2e95c75b0892c466e8e68a3b47ecb0e531f7..083874b29b6299b21bb0a127055fa23690171949 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -949,20 +949,31 @@ class ContextManagerImpl implements ContextManager {
* file.)
*/
List<String> _computeFlushedFiles(ContextInfo info) {
- AnalysisContext context = info.context;
- HashSet<String> flushedFiles = new HashSet<String>();
- for (Source source in context.sources) {
- flushedFiles.add(source.fullName);
- }
- for (ContextInfo contextInfo in rootInfo.descendants) {
- AnalysisContext contextN = contextInfo.context;
- if (context != contextN) {
- for (Source source in contextN.sources) {
- flushedFiles.remove(source.fullName);
+ if (enableNewAnalysisDriver) {
+ Set<String> flushedFiles = info.analysisDriver.knownFiles.toSet();
+ for (ContextInfo contextInfo in rootInfo.descendants) {
+ AnalysisDriver other = contextInfo.analysisDriver;
+ if (other != info.analysisDriver) {
+ flushedFiles.removeAll(other.knownFiles);
+ }
+ }
+ return flushedFiles.toList(growable: false);
+ } else {
+ AnalysisContext context = info.context;
+ HashSet<String> flushedFiles = new HashSet<String>();
+ for (Source source in context.sources) {
+ flushedFiles.add(source.fullName);
+ }
+ for (ContextInfo contextInfo in rootInfo.descendants) {
+ AnalysisContext contextN = contextInfo.context;
+ if (context != contextN) {
+ for (Source source in contextN.sources) {
+ flushedFiles.remove(source.fullName);
+ }
}
}
+ return flushedFiles.toList(growable: false);
}
- return flushedFiles.toList(growable: false);
}
/**
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analyzer/lib/src/dart/analysis/driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698