(message)
| 475 | } |
| 476 | |
| 477 | let callback: DataCallback = (message) => { |
| 478 | try { |
| 479 | // We have recevied a cancellation message. Check if the message is still in the queue |
| 480 | // and cancel it if allowed to do so. |
| 481 | if (isNotificationMessage(message) && message.method === CancelNotification.type.method) { |
| 482 | let key = createRequestQueueKey((message.params as CancelParams).id); |
| 483 | let toCancel = messageQueue.get(key); |
| 484 | if (isRequestMessage(toCancel)) { |
| 485 | let response = strategy && strategy.cancelUndispatched ? strategy.cancelUndispatched(toCancel, cancelUndispatched) : cancelUndispatched(toCancel); |
| 486 | if (response && (response.error !== void 0 || response.result !== void 0)) { |
| 487 | messageQueue.delete(key); |
| 488 | response.id = toCancel.id; |
| 489 | traceSendingResponse(response, message.method, Date.now()); |
| 490 | messageWriter.write(response); |
| 491 | return; |
| 492 | } |
| 493 | } |
| 494 | } |
| 495 | addMessageToQueue(messageQueue, message); |
| 496 | } finally { |
| 497 | triggerMessageQueue(); |
| 498 | } |
| 499 | }; |
| 500 | |
| 501 | function handleRequest(requestMessage: RequestMessage) { |
| 502 | if (isDisposed()) { |
nothing calls this directly
no test coverage detected