Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Side by Side Diff: pkg/analysis_server/lib/src/operation/operation.dart

Issue 311653002: Extract analysis/notifications into a separate operation/file. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweak for the test method name. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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' show AnalysisContext;
9 8
10 9
11 /** 10 /**
12 * The enumeration [ServerOperationPriority] defines the priority levels used 11 * The enumeration [ServerOperationPriority] defines the priority levels used
13 * to organize [ServerOperation]s in an optimal order. A smaller ordinal value 12 * to organize [ServerOperation]s in an optimal order. A smaller ordinal value
14 * equates to a higher priority. 13 * equates to a higher priority.
15 */ 14 */
16 class ServerOperationPriority { 15 class ServerOperationPriority {
17 final int ordinal; 16 final int ordinal;
18 final String name; 17 final String name;
(...skipping 20 matching lines...) Expand all
39 /** 38 /**
40 * Returns the priority of this operation. 39 * Returns the priority of this operation.
41 */ 40 */
42 ServerOperationPriority get priority; 41 ServerOperationPriority get priority;
43 42
44 /** 43 /**
45 * Performs the operation implemented by this operation. 44 * Performs the operation implemented by this operation.
46 */ 45 */
47 void perform(AnalysisServer server); 46 void perform(AnalysisServer server);
48 } 47 }
49
50
51 /**
52 * Instances of [PerformAnalysisOperation] perform a single analysis task.
53 */
54 class PerformAnalysisOperation extends ServerOperation {
55 final AnalysisContext context;
56 final bool isContinue;
57
58 PerformAnalysisOperation(this.context, this.isContinue);
59
60 @override
61 ServerOperationPriority get priority {
62 if (isContinue) {
63 return ServerOperationPriority.ANALYSIS_CONTINUE;
64 } else {
65 return ServerOperationPriority.ANALYSIS;
66 }
67 }
68
69 @override
70 void perform(AnalysisServer server) {
71 server.internalPerformAnalysis(context);
72 }
73 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698