mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 18:19:12 +01:00
Add tunnel list changed event API
This commit is contained in:
@@ -39,6 +39,8 @@ export class ExtHostTunnelService extends Disposable implements IExtHostTunnelSe
|
||||
private _forwardPortProvider: ((tunnelOptions: TunnelOptions) => Thenable<vscode.Tunnel> | undefined) | undefined;
|
||||
private _showCandidatePort: (host: string, port: number, detail: string) => Thenable<boolean> = () => { return Promise.resolve(true); };
|
||||
private _extensionTunnels: Map<string, Map<number, vscode.Tunnel>> = new Map();
|
||||
private _onDidTunnelsChange: Emitter<void> = new Emitter<void>();
|
||||
onDidTunnelsChange: vscode.Event<void> = this._onDidTunnelsChange.event;
|
||||
|
||||
constructor(
|
||||
@IExtHostRpcService extHostRpc: IExtHostRpcService,
|
||||
@@ -104,6 +106,10 @@ export class ExtHostTunnelService extends Disposable implements IExtHostTunnelSe
|
||||
}
|
||||
}
|
||||
|
||||
async $onDidTunnelsChange(): Promise<void> {
|
||||
this._onDidTunnelsChange.fire();
|
||||
}
|
||||
|
||||
$forwardPort(tunnelOptions: TunnelOptions): Promise<TunnelDto> | undefined {
|
||||
if (this._forwardPortProvider) {
|
||||
const providedPort = this._forwardPortProvider!(tunnelOptions);
|
||||
|
||||
Reference in New Issue
Block a user