| 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/source.dart'; |
| 8 | 9 |
| 9 | 10 |
| 10 /** | 11 /** |
| 11 * The class [ServerOperation] defines the behavior of objects used to perform | 12 * The class [ServerOperation] defines the behavior of objects used to perform |
| 12 * operations on a [AnalysisServer]. | 13 * operations on a [AnalysisServer]. |
| 13 */ | 14 */ |
| 14 abstract class ServerOperation { | 15 abstract class ServerOperation { |
| 15 /** | 16 /** |
| 16 * Returns the priority of this operation. | 17 * Returns the priority of this operation. |
| 17 */ | 18 */ |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 const ServerOperationPriority._(5, "ANALYSIS"); | 52 const ServerOperationPriority._(5, "ANALYSIS"); |
| 52 | 53 |
| 53 final int ordinal; | 54 final int ordinal; |
| 54 final String name; | 55 final String name; |
| 55 | 56 |
| 56 const ServerOperationPriority._(this.ordinal, this.name); | 57 const ServerOperationPriority._(this.ordinal, this.name); |
| 57 | 58 |
| 58 @override | 59 @override |
| 59 String toString() => name; | 60 String toString() => name; |
| 60 } | 61 } |
| 62 |
| 63 |
| 64 /** |
| 65 * [SourceSensitiveOperation] can decide if the operation should be discarded |
| 66 * before a change is applied to a [Source]. |
| 67 */ |
| 68 abstract class SourceSensitiveOperation extends ServerOperation { |
| 69 /** |
| 70 * The given [source] is about to be changed. |
| 71 * Check if this [SourceSensitiveOperation] should be discarded. |
| 72 */ |
| 73 bool shouldBeDiscardedOnSourceChange(Source source); |
| 74 } |
| OLD | NEW |