| Index: pkg/analysis_server/lib/src/channel/web_socket_channel.dart
|
| diff --git a/pkg/analysis_server/lib/src/channel/web_socket_channel.dart b/pkg/analysis_server/lib/src/channel/web_socket_channel.dart
|
| index 47af214ea041012feb69d2fe308582ed362ec1de..9dc4f00f194c0dfd18d5f530bd9f2d7555adb42a 100644
|
| --- a/pkg/analysis_server/lib/src/channel/web_socket_channel.dart
|
| +++ b/pkg/analysis_server/lib/src/channel/web_socket_channel.dart
|
| @@ -13,7 +13,6 @@ import 'package:analysis_server/src/channel/channel.dart';
|
| import 'package:analysis_server/src/protocol.dart';
|
| import 'package:analyzer/instrumentation/instrumentation.dart';
|
|
|
| -
|
| /**
|
| * Instances of the class [WebSocketClientChannel] implement a
|
| * [ClientCommunicationChannel] that uses a [WebSocket] to communicate with
|
| @@ -35,18 +34,19 @@ class WebSocketClientChannel implements ClientCommunicationChannel {
|
| * Initialize a new [WebSocket] wrapper for the given [socket].
|
| */
|
| WebSocketClientChannel(this.socket) {
|
| - Stream jsonStream = socket.where(
|
| - (data) =>
|
| - data is String).transform(
|
| - new JsonStreamDecoder()).where((json) => json is Map).asBroadcastStream();
|
| - responseStream = jsonStream.where(
|
| - (json) =>
|
| - json[Notification.EVENT] ==
|
| - null).transform(new ResponseConverter()).asBroadcastStream();
|
| - notificationStream = jsonStream.where(
|
| - (json) =>
|
| - json[Notification.EVENT] !=
|
| - null).transform(new NotificationConverter()).asBroadcastStream();
|
| + Stream jsonStream = socket
|
| + .where((data) => data is String)
|
| + .transform(new JsonStreamDecoder())
|
| + .where((json) => json is Map)
|
| + .asBroadcastStream();
|
| + responseStream = jsonStream
|
| + .where((json) => json[Notification.EVENT] == null)
|
| + .transform(new ResponseConverter())
|
| + .asBroadcastStream();
|
| + notificationStream = jsonStream
|
| + .where((json) => json[Notification.EVENT] != null)
|
| + .transform(new NotificationConverter())
|
| + .asBroadcastStream();
|
| }
|
|
|
| @override
|
| @@ -89,12 +89,10 @@ class WebSocketServerChannel implements ServerCommunicationChannel {
|
| }
|
|
|
| @override
|
| - void listen(void onRequest(Request request), {void onError(), void
|
| - onDone()}) {
|
| - socket.listen(
|
| - (data) => readRequest(data, onRequest),
|
| - onError: onError,
|
| - onDone: onDone);
|
| + void listen(void onRequest(Request request),
|
| + {void onError(), void onDone()}) {
|
| + socket.listen((data) => readRequest(data, onRequest),
|
| + onError: onError, onDone: onDone);
|
| }
|
|
|
| /**
|
|
|