Index: pkg/analysis_server/lib/src/domain_server.dart |
diff --git a/pkg/analysis_server/lib/src/domain_server.dart b/pkg/analysis_server/lib/src/domain_server.dart |
index 95d12bdf5c68ae221f43abf1ee232bb043c1d05f..ccd12bc9dbcfa6e8c2ea3a0838dd343b982c072f 100644 |
--- a/pkg/analysis_server/lib/src/domain_server.dart |
+++ b/pkg/analysis_server/lib/src/domain_server.dart |
@@ -2,6 +2,8 @@ |
// for details. All rights reserved. Use of this source code is governed by a |
// BSD-style license that can be found in the LICENSE file. |
+import 'dart:async'; |
+ |
import 'package:analysis_server/protocol/protocol.dart'; |
import 'package:analysis_server/protocol/protocol_constants.dart'; |
import 'package:analysis_server/protocol/protocol_generated.dart'; |
@@ -39,7 +41,8 @@ class ServerDomainHandler implements RequestHandler { |
} else if (requestName == SERVER_REQUEST_SET_SUBSCRIPTIONS) { |
return setSubscriptions(request); |
} else if (requestName == SERVER_REQUEST_SHUTDOWN) { |
- return shutdown(request); |
+ shutdown(request); |
+ return Response.DELAYED_RESPONSE; |
} |
} on RequestFailure catch (exception) { |
return exception.response; |
@@ -63,9 +66,9 @@ class ServerDomainHandler implements RequestHandler { |
/** |
* Cleanly shutdown the analysis server. |
*/ |
- Response shutdown(Request request) { |
- server.shutdown(); |
+ Future<Null> shutdown(Request request) async { |
+ await server.shutdown(); |
Response response = new ServerShutdownResult().toResponse(request.id); |
- return response; |
+ server.sendResponse(response); |
} |
} |