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

Side by Side Diff: pkg/analyzer/lib/src/task/dart_work_manager.dart

Issue 2155023002: Don't schedule SOURCE_KIND computation when it is know already. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/dart_work_manager_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/dart_work_manager_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698