Tunnels from a tunnel factory can have async dispose

This commit is contained in:
Alex Ross
2021-01-07 11:33:46 +01:00
parent a84603f49f
commit 14bb2fdc12
8 changed files with 21 additions and 19 deletions

View File

@@ -30,11 +30,11 @@ class ExtensionTunnel implements vscode.Tunnel {
constructor(
public readonly remoteAddress: { port: number, host: string },
public readonly localAddress: { port: number, host: string } | string,
private readonly _dispose: () => void) { }
private readonly _dispose: () => Promise<void>) { }
dispose(): void {
dispose(): Promise<void> {
this._onDispose.fire();
this._dispose();
return this._dispose();
}
}
@@ -212,7 +212,7 @@ export class ExtHostTunnelService extends Disposable implements IExtHostTunnelSe
if (silent) {
hostMap.get(remote.port)!.disposeListener.dispose();
}
hostMap.get(remote.port)!.tunnel.dispose();
await hostMap.get(remote.port)!.tunnel.dispose();
hostMap.delete(remote.port);
}
}