diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 2c54a462802..16efd0d855f 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -6269,6 +6269,28 @@ declare module 'vscode' { * @returns A promise indicating if open was successful. */ export function openExternal(target: Uri): Thenable; + + /** + * Resolves an *external* uri, such as a `http:` or `https:` link, from where the extension is running to a + * uri to the same resource on the client machine. + * + * This is a no-op if the extension is running on the client machine. Currently only supports + * `https:` and `http:` uris. + * + * If the extension is running remotely, this function automatically establishes a port forwarding tunnel + * from the local machine to `target` on the remote and returns a local uri to the tunnel. The lifetime of + * the port fowarding tunnel is managed by VS Code and the tunnel can be closed by the user. + * + * Extensions should not cache the result of `asExternalUri` as the resolved uri may become invalid due to + * a system or user action — for example, in remote cases, a user may close a port forwardng tunnel + * that was opened by `asExternalUri`. + * + * Note: uris passed through `openExternal` are automatically resolved and you should not call `asExternalUri` + * on them. + * + * @return A uri that can be used on the client machine. + */ + export function asExternalUri(target: Uri): Thenable; } /** diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index a262be9e137..23ea710e6b3 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1065,32 +1065,4 @@ declare module 'vscode' { } //#endregion - - // #region asExternalUri — mjbvz - - namespace env { - /** - * Resolves an *external* uri, such as a `http:` or `https:` link, from where the extension is running to a - * uri to the same resource on the client machine. - * - * This is a no-op if the extension is running on the client machine. Currently only supports - * `https:` and `http:` uris. - * - * If the extension is running remotely, this function automatically establishes a port forwarding tunnel - * from the local machine to `target` on the remote and returns a local uri to the tunnel. The lifetime of - * the port fowarding tunnel is managed by VS Code and the tunnel can be closed by the user. - * - * Extensions should not cache the result of `asExternalUri` as the resolved uri may become invalid due to - * a system or user action — for example, in remote cases, a user may close a port forwardng tunnel - * that was opened by `asExternalUri`. - * - * Note: uris passed through `openExternal` are automatically resolved and you should not call `asExternalUri` - * on them. - * - * @return A uri that can be used on the client machine. - */ - export function asExternalUri(target: Uri): Thenable; - } - - //#endregion } diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index e5b5d50ff01..382a762d930 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -248,7 +248,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I return extHostWindow.openUri(uri, { allowTunneling: !!initData.remote.isRemote }); }, asExternalUri(uri: URI) { - checkProposedApiEnabled(extension); return extHostWindow.asExternalUri(uri, { allowTunneling: !!initData.remote.isRemote }); }, get remoteName() {