| 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 analysis.server; | 5 library analysis.server; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:analysis_server/src/analysis_logger.dart'; | 10 import 'package:analysis_server/src/analysis_logger.dart'; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 * propagated up the call stack. The default is true to allow analysis | 134 * propagated up the call stack. The default is true to allow analysis |
| 135 * exceptions to show up in unit tests, but it should be set to false when | 135 * exceptions to show up in unit tests, but it should be set to false when |
| 136 * running a full analysis server. | 136 * running a full analysis server. |
| 137 */ | 137 */ |
| 138 AnalysisServer(this.channel, ResourceProvider resourceProvider, | 138 AnalysisServer(this.channel, ResourceProvider resourceProvider, |
| 139 {this.rethrowExceptions: true}) { | 139 {this.rethrowExceptions: true}) { |
| 140 operationQueue = new ServerOperationQueue(this); | 140 operationQueue = new ServerOperationQueue(this); |
| 141 contextDirectoryManager = new AnalysisServerContextDirectoryManager(this, re
sourceProvider); | 141 contextDirectoryManager = new AnalysisServerContextDirectoryManager(this, re
sourceProvider); |
| 142 AnalysisEngine.instance.logger = new AnalysisLogger(); | 142 AnalysisEngine.instance.logger = new AnalysisLogger(); |
| 143 running = true; | 143 running = true; |
| 144 Notification notification = new Notification(NOTIFICATION_CONNECTED); | 144 Notification notification = new Notification(SERVER_CONNECTED); |
| 145 channel.sendNotification(notification); | 145 channel.sendNotification(notification); |
| 146 channel.listen(handleRequest, onDone: done, onError: error); | 146 channel.listen(handleRequest, onDone: done, onError: error); |
| 147 } | 147 } |
| 148 | 148 |
| 149 /** | 149 /** |
| 150 * Schedules analysis of the given context. | 150 * Schedules analysis of the given context. |
| 151 */ | 151 */ |
| 152 void schedulePerformAnalysisOperation(AnalysisContext context) { | 152 void schedulePerformAnalysisOperation(AnalysisContext context) { |
| 153 scheduleOperation(new PerformAnalysisOperation(context, false)); | 153 scheduleOperation(new PerformAnalysisOperation(context, false)); |
| 154 } | 154 } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 sendStatusNotification(null); | 253 sendStatusNotification(null); |
| 254 } | 254 } |
| 255 } | 255 } |
| 256 } | 256 } |
| 257 | 257 |
| 258 /** | 258 /** |
| 259 * Send status notification to the client. The `contextId` indicates | 259 * Send status notification to the client. The `contextId` indicates |
| 260 * the current context being analyzed or `null` if analysis is complete. | 260 * the current context being analyzed or `null` if analysis is complete. |
| 261 */ | 261 */ |
| 262 void sendStatusNotification(String contextId) { | 262 void sendStatusNotification(String contextId) { |
| 263 Notification notification = new Notification(NOTIFICATION_STATUS); | 263 Notification notification = new Notification(SERVER_STATUS); |
| 264 Map<String, Object> analysis = new Map(); | 264 Map<String, Object> analysis = new Map(); |
| 265 if (contextId != null) { | 265 if (contextId != null) { |
| 266 analysis['analyzing'] = true; | 266 analysis['analyzing'] = true; |
| 267 // TODO(danrubel): replace contextId with real analysisTarget | 267 // TODO(danrubel): replace contextId with real analysisTarget |
| 268 analysis['analysisTarget'] = contextId; | 268 analysis['analysisTarget'] = contextId; |
| 269 } else { | 269 } else { |
| 270 analysis['analyzing'] = false; | 270 analysis['analyzing'] = false; |
| 271 } | 271 } |
| 272 notification.params['analysis'] = analysis; | 272 notification.params['analysis'] = analysis; |
| 273 channel.sendNotification(notification); | 273 channel.sendNotification(notification); |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 /** | 489 /** |
| 490 * An enumeration of the services provided by the server domain. | 490 * An enumeration of the services provided by the server domain. |
| 491 */ | 491 */ |
| 492 class ServerService extends Enum2<ServerService> { | 492 class ServerService extends Enum2<ServerService> { |
| 493 static const ServerService STATUS = const ServerService('STATUS', 0); | 493 static const ServerService STATUS = const ServerService('STATUS', 0); |
| 494 | 494 |
| 495 static const List<ServerService> VALUES = const [STATUS]; | 495 static const List<ServerService> VALUES = const [STATUS]; |
| 496 | 496 |
| 497 const ServerService(String name, int ordinal) : super(name, ordinal); | 497 const ServerService(String name, int ordinal) : super(name, ordinal); |
| 498 } | 498 } |
| OLD | NEW |