1
0
Fork 0

Damn GitHub editor

pull/178/head
Felix Becker 2016-11-22 15:59:27 +01:00 committed by GitHub
parent 7c5ca5eb6a
commit bb07a1364e
1 changed files with 3 additions and 1 deletions

View File

@ -67,6 +67,7 @@ class LanguageServer extends AdvancedJsonRpc\Dispatcher
$this->protocolReader = $reader;
$this->protocolReader->on('message', function (Message $msg) {
coroutine(function () use ($msg) {
// Ignore responses, this is the handler for requests and notifications
if (AdvancedJsonRpc\Response::isResponse($msg->body)) {
return;
@ -88,7 +89,8 @@ class LanguageServer extends AdvancedJsonRpc\Dispatcher
$e
);
}
// Only send a Response for a Request // Notifications do not send Responses
// Only send a Response for a Request
// Notifications do not send Responses
if (AdvancedJsonRpc\Request::isRequest($msg->body)) {
if ($error !== null) {
$responseBody = new AdvancedJsonRpc\ErrorResponse($msg->body->id, $error);