Chromium Code Reviews| Index: pkg/analysis_server/lib/src/operation/operation_queue.dart |
| diff --git a/pkg/analysis_server/lib/src/operation/operation_queue.dart b/pkg/analysis_server/lib/src/operation/operation_queue.dart |
| index 7ea825759599e6e047531dc6ef25c9c6a66f3a3c..8163174859ae0e10072529854369dbd1ebda4278 100644 |
| --- a/pkg/analysis_server/lib/src/operation/operation_queue.dart |
| +++ b/pkg/analysis_server/lib/src/operation/operation_queue.dart |
| @@ -8,6 +8,7 @@ import 'dart:collection'; |
| import 'package:analysis_server/src/analysis_server.dart'; |
| import 'package:analysis_server/src/operation/operation.dart'; |
| +import 'package:analyzer/src/generated/engine.dart'; |
| import 'package:analyzer/src/generated/source.dart'; |
| /** |
| @@ -51,6 +52,17 @@ class ServerOperationQueue { |
| } |
| /** |
| + * The given [context] has been removed, so all pending operations that refer |
| + * to it should be removed from the queue. |
| + */ |
| + void contextRemoved(AnalysisContext context) { |
| + for (Queue<ServerOperation> queue in _queues) { |
| + queue.removeWhere( |
| + (ServerOperation operation) => operation.context == context); |
|
scheglov
2015/03/06 00:37:23
IMHO if there is a line break, the function is too
Paul Berry
2015/03/06 01:11:09
Hmm, I'm not sure if I agree with the general prin
|
| + } |
| + } |
| + |
| + /** |
| * Return the next operation to perform, or `null` if the queue is empty. |
| * This method does not change the queue. |
| */ |