mirror of
https://github.com/Microsoft/vscode
synced 2024-08-25 03:56:03 +00:00
web: add didResolveRemoteAuthority function for embedders (#209480)
This commit is contained in:
parent
feb823cc57
commit
efee188faf
|
@ -106,6 +106,10 @@ export interface IWorkbench {
|
|||
};
|
||||
|
||||
workspace: {
|
||||
/**
|
||||
* Resolves once the remote authority has been resolved.
|
||||
*/
|
||||
didResolveRemoteAuthority(): Promise<void>;
|
||||
|
||||
/**
|
||||
* Forwards a port. If the current embedder implements a tunnelFactory then that will be used to make the tunnel.
|
||||
|
|
|
@ -154,6 +154,14 @@ export namespace window {
|
|||
|
||||
export namespace workspace {
|
||||
|
||||
/**
|
||||
* {@linkcode IWorkbench.workspace IWorkbench.workspace.didResolveRemoteAuthority}
|
||||
*/
|
||||
export async function didResolveRemoteAuthority() {
|
||||
const workbench = await workbenchPromise.p;
|
||||
await workbench.workspace.didResolveRemoteAuthority();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@linkcode IWorkbench.workspace IWorkbench.workspace.openTunnel}
|
||||
*/
|
||||
|
|
|
@ -156,6 +156,7 @@ export class BrowserMain extends Disposable {
|
|||
const remoteExplorerService = accessor.get(IRemoteExplorerService);
|
||||
const labelService = accessor.get(ILabelService);
|
||||
const embedderTerminalService = accessor.get(IEmbedderTerminalService);
|
||||
const remoteAuthorityResolverService = accessor.get(IRemoteAuthorityResolverService);
|
||||
|
||||
let logger: DelayedLogChannel | undefined = undefined;
|
||||
|
||||
|
@ -190,6 +191,13 @@ export class BrowserMain extends Disposable {
|
|||
createTerminal: async (options) => embedderTerminalService.createTerminal(options),
|
||||
},
|
||||
workspace: {
|
||||
didResolveRemoteAuthority: async () => {
|
||||
if (!this.configuration.remoteAuthority) {
|
||||
return;
|
||||
}
|
||||
|
||||
await remoteAuthorityResolverService.resolveAuthority(this.configuration.remoteAuthority);
|
||||
},
|
||||
openTunnel: async tunnelOptions => {
|
||||
const tunnel = assertIsDefined(await remoteExplorerService.forward({
|
||||
remote: tunnelOptions.remoteAddress,
|
||||
|
|
Loading…
Reference in a new issue