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

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

Issue 958373003: Don't remove indexing operations on potential source changes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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/analysis_server/lib/src/analysis_server.dart
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index a99cbebf283fbd1f90efff3f07513df32eeea9ba..b33ccd8efa912bf8520d959f105fdf01df9083dc 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -661,7 +661,6 @@ class AnalysisServer {
* Perform the next available [ServerOperation].
*/
void performOperation() {
- assert(performOperationPending);
Paul Berry 2015/02/27 22:05:00 Why remove this assertion? AFAICT this invariant
scheglov 2015/02/28 01:34:35 I found the problem in my test code. And you are r
PerformanceTag.UNKNOWN.makeCurrent();
performOperationPending = false;
if (!running) {
@@ -1030,18 +1029,21 @@ class AnalysisServer {
// source contents.
// TODO(scheglov) consider checking if there are subscriptions.
if (AnalysisEngine.isDartFileName(file)) {
- CompilationUnit dartUnit =
- context.ensureAnyResolvedDartUnit(source);
- if (dartUnit != null) {
+ List<CompilationUnit> dartUnits =
+ context.ensureResolvedDartUnits(source);
+ if (dartUnits != null) {
AnalysisErrorInfo errorInfo = context.getErrors(source);
- scheduleNotificationOperations(
- this,
- file,
- errorInfo.lineInfo,
- context,
- null,
- dartUnit,
- errorInfo.errors);
+ for (var dartUnit in dartUnits) {
+ scheduleNotificationOperations(
+ this,
+ file,
+ errorInfo.lineInfo,
+ context,
+ null,
+ dartUnit,
+ errorInfo.errors);
+ scheduleIndexOperation(this, file, context, dartUnit);
+ }
} else {
schedulePerformAnalysisOperation(context);
}

Powered by Google App Engine
This is Rietveld 408576698