From 31b67062b013ec5039c96e534e52891462edc2b1 Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 12 Nov 2020 11:17:45 -0600 Subject: [PATCH] Remove from onMessage Turns out that while Typescript can't infer the callback return type from it, Typescript can do the opposite and infer it from the callback return type. --- src/node/vscode.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/vscode.ts b/src/node/vscode.ts index 6761a6d18..089a3d201 100644 --- a/src/node/vscode.ts +++ b/src/node/vscode.ts @@ -69,7 +69,7 @@ export class VscodeProvider { vscode, ) - const message = await this.onMessage(vscode, (message): message is ipc.OptionsMessage => { + const message = await this.onMessage(vscode, (message): message is ipc.OptionsMessage => { // There can be parallel initializations so wait for the right ID. return message.type === "options" && message.id === id }) @@ -104,7 +104,7 @@ export class VscodeProvider { dispose() }) - this._vscode = this.onMessage(vscode, (message): message is ipc.ReadyMessage => { + this._vscode = this.onMessage(vscode, (message): message is ipc.ReadyMessage => { return message.type === "ready" }).then(() => vscode)