Remove <type> 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.
This commit is contained in:
parent
72931edcf0
commit
31b67062b0
@ -69,7 +69,7 @@ export class VscodeProvider {
|
|||||||
vscode,
|
vscode,
|
||||||
)
|
)
|
||||||
|
|
||||||
const message = await this.onMessage<ipc.OptionsMessage>(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.
|
// There can be parallel initializations so wait for the right ID.
|
||||||
return message.type === "options" && message.id === id
|
return message.type === "options" && message.id === id
|
||||||
})
|
})
|
||||||
@ -104,7 +104,7 @@ export class VscodeProvider {
|
|||||||
dispose()
|
dispose()
|
||||||
})
|
})
|
||||||
|
|
||||||
this._vscode = this.onMessage<ipc.ReadyMessage>(vscode, (message): message is ipc.ReadyMessage => {
|
this._vscode = this.onMessage(vscode, (message): message is ipc.ReadyMessage => {
|
||||||
return message.type === "ready"
|
return message.type === "ready"
|
||||||
}).then(() => vscode)
|
}).then(() => vscode)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user