| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 import 'dart:io' show Platform, Process, ProcessResult; | 8 import 'dart:io' show Platform, Process, ProcessResult; |
| 9 | 9 |
| 10 import 'package:analysis_server/src/plugin/notification_manager.dart'; | 10 import 'package:analysis_server/src/plugin/notification_manager.dart'; |
| (...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 } | 885 } |
| 886 } | 886 } |
| 887 info.notificationManager | 887 info.notificationManager |
| 888 .handlePluginNotification(info.pluginId, notification); | 888 .handlePluginNotification(info.pluginId, notification); |
| 889 } | 889 } |
| 890 | 890 |
| 891 /** | 891 /** |
| 892 * Handle the fact that the plugin has stopped. | 892 * Handle the fact that the plugin has stopped. |
| 893 */ | 893 */ |
| 894 void handleOnDone() { | 894 void handleOnDone() { |
| 895 channel.close(); | 895 if (channel != null) { |
| 896 channel = null; | 896 channel.close(); |
| 897 channel = null; |
| 898 } |
| 897 pluginStoppedCompleter.complete(null); | 899 pluginStoppedCompleter.complete(null); |
| 898 } | 900 } |
| 899 | 901 |
| 900 /** | 902 /** |
| 901 * Handle the fact that an unhandled error has occurred in the plugin. | 903 * Handle the fact that an unhandled error has occurred in the plugin. |
| 902 */ | 904 */ |
| 903 void handleOnError(List<String> errorPair) { | 905 void handleOnError(List<String> errorPair) { |
| 904 // TODO(brianwilkerson) Decide how we want to handle errors. | 906 // TODO(brianwilkerson) Decide how we want to handle errors. |
| 905 info.instrumentationService.logPluginException( | 907 info.instrumentationService.logPluginException( |
| 906 info.data, errorPair[0], new StackTrace.fromString(errorPair[1])); | 908 info.data, errorPair[0], new StackTrace.fromString(errorPair[1])); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 * The completer that will be used to complete the future when the response is | 1035 * The completer that will be used to complete the future when the response is |
| 1034 * received from the plugin. | 1036 * received from the plugin. |
| 1035 */ | 1037 */ |
| 1036 final Completer<Response> completer; | 1038 final Completer<Response> completer; |
| 1037 | 1039 |
| 1038 /** | 1040 /** |
| 1039 * Initialize a pending request. | 1041 * Initialize a pending request. |
| 1040 */ | 1042 */ |
| 1041 _PendingRequest(this.method, this.requestTime, this.completer); | 1043 _PendingRequest(this.method, this.requestTime, this.completer); |
| 1042 } | 1044 } |
| OLD | NEW |