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

Unified Diff: pkg/analysis_server/lib/src/operation/operation_analysis.dart

Issue 2267273004: Use FlushTargetFilter to pre-filter targets before checking their results. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/context/cache.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/operation/operation_analysis.dart
diff --git a/pkg/analysis_server/lib/src/operation/operation_analysis.dart b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
index 90d77a97ae43263e86a944b61397163583397be9..3263d2b6923a31e1a338211bbb836b858b80dd64 100644
--- a/pkg/analysis_server/lib/src/operation/operation_analysis.dart
+++ b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
@@ -22,6 +22,7 @@ import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/error.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/task/dart.dart';
import 'package:analyzer/task/model.dart';
/**
@@ -399,15 +400,15 @@ class PerformAnalysisOperation extends ServerOperation {
InternalAnalysisContext context = this.context;
// Flush AST results for source outside of the analysis roots.
ContextManager contextManager = server.contextManager;
- context.analysisCache.flush((target, result) {
- Source targetSource = target.source;
- if (result is ResultDescriptor<CompilationUnit> &&
- targetSource != null &&
- !context.prioritySources.contains(targetSource) &&
- !contextManager.isInAnalysisRoot(targetSource.fullName)) {
- return true;
+ context.analysisCache.flush((target) {
+ if (target is Source || target is LibrarySpecificUnit) {
+ Source targetSource = target.source;
+ return !context.prioritySources.contains(targetSource) &&
+ !contextManager.isInAnalysisRoot(targetSource.fullName);
}
return false;
+ }, (target, result) {
+ return result is ResultDescriptor<CompilationUnit>;
});
}
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/context/cache.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698