| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 WorkOrderPriority getNextResultPriority() { | 235 WorkOrderPriority getNextResultPriority() { |
| 236 if (priorityResultQueue.isNotEmpty) { | 236 if (priorityResultQueue.isNotEmpty) { |
| 237 return WorkOrderPriority.PRIORITY; | 237 return WorkOrderPriority.PRIORITY; |
| 238 } | 238 } |
| 239 if (unknownSourceQueue.isNotEmpty || librarySourceQueue.isNotEmpty) { | 239 if (unknownSourceQueue.isNotEmpty || librarySourceQueue.isNotEmpty) { |
| 240 return WorkOrderPriority.NORMAL; | 240 return WorkOrderPriority.NORMAL; |
| 241 } | 241 } |
| 242 return WorkOrderPriority.NONE; | 242 return WorkOrderPriority.NONE; |
| 243 } | 243 } |
| 244 | 244 |
| 245 void unitIncrementallyResolved(Source librarySource, Source unitSource) { |
| 246 librarySourceQueue.add(librarySource); |
| 247 } |
| 248 |
| 245 @override | 249 @override |
| 246 void resultsComputed( | 250 void resultsComputed( |
| 247 AnalysisTarget target, Map<ResultDescriptor, dynamic> outputs) { | 251 AnalysisTarget target, Map<ResultDescriptor, dynamic> outputs) { |
| 248 // Organize sources. | 252 // Organize sources. |
| 249 if (_isDartSource(target)) { | 253 if (_isDartSource(target)) { |
| 250 SourceKind kind = outputs[SOURCE_KIND]; | 254 SourceKind kind = outputs[SOURCE_KIND]; |
| 251 if (kind != null) { | 255 if (kind != null) { |
| 252 unknownSourceQueue.remove(target); | 256 unknownSourceQueue.remove(target); |
| 253 if (kind == SourceKind.LIBRARY) { | 257 if (kind == SourceKind.LIBRARY) { |
| 254 librarySourceQueue.add(target); | 258 librarySourceQueue.add(target); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 | 337 |
| 334 static bool _isDartSource(AnalysisTarget target) { | 338 static bool _isDartSource(AnalysisTarget target) { |
| 335 return target is Source && AnalysisEngine.isDartFileName(target.fullName); | 339 return target is Source && AnalysisEngine.isDartFileName(target.fullName); |
| 336 } | 340 } |
| 337 | 341 |
| 338 static bool _isErrorResult(ResultDescriptor descriptor) { | 342 static bool _isErrorResult(ResultDescriptor descriptor) { |
| 339 return _SOURCE_ERRORS.contains(descriptor) || | 343 return _SOURCE_ERRORS.contains(descriptor) || |
| 340 _UNIT_ERRORS.contains(descriptor); | 344 _UNIT_ERRORS.contains(descriptor); |
| 341 } | 345 } |
| 342 } | 346 } |
| OLD | NEW |