mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-29 21:11:38 +01:00
Let IRPCProtocol#getProxy return Proxied<T> which enforces functions returning promises
fyi @sandy081 had to remove the overload of `MainThreadOutputServiceShape#$update` because I couldn't get this to work with mapped types fyi @Tyriar this fixed an actual issue with terminals
This commit is contained in:
@@ -196,7 +196,7 @@ export class ExtHostCommands implements ExtHostCommandsShape {
|
||||
});
|
||||
|
||||
try {
|
||||
const result = await this.#proxy.$executeCommand<T>(id, hasBuffers ? new SerializableObjectWithBuffers(toArgs) : toArgs, retry);
|
||||
const result = await this.#proxy.$executeCommand(id, hasBuffers ? new SerializableObjectWithBuffers(toArgs) : toArgs, retry);
|
||||
return revive<any>(result);
|
||||
} catch (e) {
|
||||
// Rerun the command when it wasn't known, had arguments, and when retry
|
||||
@@ -211,7 +211,7 @@ export class ExtHostCommands implements ExtHostCommandsShape {
|
||||
}
|
||||
}
|
||||
|
||||
private async _executeContributedCommand<T>(id: string, args: any[], annotateError: boolean): Promise<T> {
|
||||
private async _executeContributedCommand<T = unknown>(id: string, args: any[], annotateError: boolean): Promise<T> {
|
||||
const command = this._commands.get(id);
|
||||
if (!command) {
|
||||
throw new Error('Unknown command');
|
||||
@@ -254,7 +254,7 @@ export class ExtHostCommands implements ExtHostCommandsShape {
|
||||
}
|
||||
}
|
||||
|
||||
$executeContributedCommand<T>(id: string, ...args: any[]): Promise<T> {
|
||||
$executeContributedCommand(id: string, ...args: any[]): Promise<unknown> {
|
||||
this._logService.trace('ExtHostCommands#$executeContributedCommand', id);
|
||||
|
||||
if (!this._commands.has(id)) {
|
||||
|
||||
Reference in New Issue
Block a user