Skip to content

Commit

Permalink
Improve docs on asExternalUri
Browse files Browse the repository at this point in the history
Fixes #81709
  • Loading branch information
mjbvz committed Oct 1, 2019
1 parent 00b1067 commit 3793cb9
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/vs/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1110,23 +1110,25 @@ declare module 'vscode' {

//#endregion

// #region resolveExternalUri — mjbvz
// #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 locally. Currently only supports `https:` and `http:`.
* 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 port forwarding from
* the local machine to `target` on the remote and returns a local uri that can be used to for this connection.
* 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 store the result of `resolveExternalUri` 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 that was forwarded by
* `resolveExternalUri`.
* 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 `resolveExternalUri`
* 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.
Expand Down

0 comments on commit 3793cb9

Please sign in to comment.