OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 operation; | 5 library operation; |
6 | 6 |
7 import 'package:analysis_server/src/analysis_server.dart'; | 7 import 'package:analysis_server/src/analysis_server.dart'; |
8 import 'package:analyzer/src/generated/engine.dart'; | 8 import 'package:analyzer/src/generated/engine.dart'; |
9 import 'package:analyzer/src/generated/source.dart'; | 9 import 'package:analyzer/src/generated/source.dart'; |
10 | 10 |
11 /** | 11 /** |
| 12 * [MergeableOperation] can decide whether other operation can be merged into |
| 13 * it, so that it should not be added as a separate operation. |
| 14 */ |
| 15 abstract class MergeableOperation extends ServerOperation { |
| 16 MergeableOperation(AnalysisContext context) : super(context); |
| 17 |
| 18 /** |
| 19 * Attempt to merge the given [other] operation into this one, return `true` |
| 20 * in case of success, so that [other] should not be added as a separate |
| 21 * operation. |
| 22 */ |
| 23 bool merge(ServerOperation other); |
| 24 } |
| 25 |
| 26 /** |
12 * The class [ServerOperation] defines the behavior of objects used to perform | 27 * The class [ServerOperation] defines the behavior of objects used to perform |
13 * operations on a [AnalysisServer]. | 28 * operations on a [AnalysisServer]. |
14 */ | 29 */ |
15 abstract class ServerOperation { | 30 abstract class ServerOperation { |
16 /** | 31 /** |
17 * The context for this operation. Operations will be automatically | 32 * The context for this operation. Operations will be automatically |
18 * de-queued when their context is destroyed. | 33 * de-queued when their context is destroyed. |
19 */ | 34 */ |
20 final AnalysisContext context; | 35 final AnalysisContext context; |
21 | 36 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 */ | 88 */ |
74 abstract class SourceSensitiveOperation extends ServerOperation { | 89 abstract class SourceSensitiveOperation extends ServerOperation { |
75 SourceSensitiveOperation(AnalysisContext context) : super(context); | 90 SourceSensitiveOperation(AnalysisContext context) : super(context); |
76 | 91 |
77 /** | 92 /** |
78 * The given [source] is about to be changed. | 93 * The given [source] is about to be changed. |
79 * Check if this [SourceSensitiveOperation] should be discarded. | 94 * Check if this [SourceSensitiveOperation] should be discarded. |
80 */ | 95 */ |
81 bool shouldBeDiscardedOnSourceChange(Source source); | 96 bool shouldBeDiscardedOnSourceChange(Source source); |
82 } | 97 } |
OLD | NEW |