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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 * contexts. | 103 * contexts. |
104 */ | 104 */ |
105 CachePartition get privateAnalysisCachePartition => | 105 CachePartition get privateAnalysisCachePartition => |
106 context.privateAnalysisCachePartition; | 106 context.privateAnalysisCachePartition; |
107 | 107 |
108 /** | 108 /** |
109 * Specifies that the client want the given [result] of the given [target] | 109 * Specifies that the client want the given [result] of the given [target] |
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 |
| 114 .add(new TargetedResult(context.canonicalizeTarget(target), result)); |
114 } | 115 } |
115 | 116 |
116 @override | 117 @override |
117 void applyChange(List<Source> addedSources, List<Source> changedSources, | 118 void applyChange(List<Source> addedSources, List<Source> changedSources, |
118 List<Source> removedSources) { | 119 List<Source> removedSources) { |
119 addedSources = addedSources.where(_isDartSource).toList(); | 120 addedSources = addedSources.where(_isDartSource).toList(); |
120 changedSources = changedSources.where(_isDartSource).toList(); | 121 changedSources = changedSources.where(_isDartSource).toList(); |
121 removedSources = removedSources.where(_isDartSource).toList(); | 122 removedSources = removedSources.where(_isDartSource).toList(); |
122 // unknown queue | 123 // unknown queue |
123 unknownSourceQueue.addAll(addedSources); | 124 unknownSourceQueue.addAll(addedSources); |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 } | 471 } |
471 } | 472 } |
472 | 473 |
473 bool _shouldErrorsBeComputed(Source source) => | 474 bool _shouldErrorsBeComputed(Source source) => |
474 context.shouldErrorsBeAnalyzed(source); | 475 context.shouldErrorsBeAnalyzed(source); |
475 | 476 |
476 static bool _isDartSource(AnalysisTarget target) { | 477 static bool _isDartSource(AnalysisTarget target) { |
477 return target is Source && AnalysisEngine.isDartFileName(target.fullName); | 478 return target is Source && AnalysisEngine.isDartFileName(target.fullName); |
478 } | 479 } |
479 } | 480 } |
OLD | NEW |