OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library analyzer.src.task.dart_work_manager; | 5 library analyzer.src.task.dart_work_manager; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/src/context/cache.dart'; | 9 import 'package:analyzer/src/context/cache.dart'; |
10 import 'package:analyzer/src/generated/engine.dart' | 10 import 'package:analyzer/src/generated/engine.dart' |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 * to be computed with priority. | 110 * to be computed with priority. |
111 */ | 111 */ |
112 void addPriorityResult(AnalysisTarget target, ResultDescriptor result) { | 112 void addPriorityResult(AnalysisTarget target, ResultDescriptor result) { |
113 priorityResultQueue.add(new TargetedResult(target, result)); | 113 priorityResultQueue.add(new TargetedResult(target, result)); |
114 } | 114 } |
115 | 115 |
116 @override | 116 @override |
117 void applyChange(List<Source> addedSources, List<Source> changedSources, | 117 void applyChange(List<Source> addedSources, List<Source> changedSources, |
118 List<Source> removedSources) { | 118 List<Source> removedSources) { |
119 addedSources = addedSources.where(_isDartSource).toList(); | 119 addedSources = addedSources.where(_isDartSource).toList(); |
120 changedSources = changedSources.where(_isDartSource).toList(); | 120 changedSources = changedSources |
| 121 .where(_isDartSource) |
| 122 .where((source) => _needsComputing(source, SOURCE_KIND)) |
| 123 .toList(); |
121 removedSources = removedSources.where(_isDartSource).toList(); | 124 removedSources = removedSources.where(_isDartSource).toList(); |
122 // unknown queue | 125 // unknown queue |
123 unknownSourceQueue.addAll(addedSources); | 126 unknownSourceQueue.addAll(addedSources); |
124 unknownSourceQueue.addAll(changedSources); | 127 unknownSourceQueue.addAll(changedSources); |
125 unknownSourceQueue.removeAll(removedSources); | 128 unknownSourceQueue.removeAll(removedSources); |
126 // library queue | 129 // library queue |
127 librarySourceQueue.removeAll(changedSources); | 130 librarySourceQueue.removeAll(changedSources); |
128 librarySourceQueue.removeAll(removedSources); | 131 librarySourceQueue.removeAll(removedSources); |
129 // parts in libraries | 132 // parts in libraries |
130 for (Source changedSource in changedSources) { | 133 for (Source changedSource in changedSources) { |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 } | 473 } |
471 } | 474 } |
472 | 475 |
473 bool _shouldErrorsBeComputed(Source source) => | 476 bool _shouldErrorsBeComputed(Source source) => |
474 context.shouldErrorsBeAnalyzed(source); | 477 context.shouldErrorsBeAnalyzed(source); |
475 | 478 |
476 static bool _isDartSource(AnalysisTarget target) { | 479 static bool _isDartSource(AnalysisTarget target) { |
477 return target is Source && AnalysisEngine.isDartFileName(target.fullName); | 480 return target is Source && AnalysisEngine.isDartFileName(target.fullName); |
478 } | 481 } |
479 } | 482 } |
OLD | NEW |