You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I talked with Kai about the "debugger launch" scenario in my 1:1 last week. In my specific scenario, I think the requirements you have are sufficient. Most of the potential fancy stuff I do would be driven OOB, e.g. by the mirroring http server providing the debugging and communication pipe.
/** * Handles opening external uris. * * An extension can use this to open a `http` link to a webserver inside of VS Code instead of * having the link be opened by the webbrowser. * * Currently openers may only be registered for `http` and `https` uris. */exportinterfaceExternalUriOpener{/** * Try to open a given uri. * * @param uri The uri being opened. * @param ctx Additional metadata about how the open was triggered. * @param token Cancellation token. * * @return Optional command that opens the uri. If no command is returned, VS Code will * continue checking to see if any other openers are available. * * If multiple openers are available for a given uri, then the `Command.title` is shown in the UI. */openExternalUri(uri: Uri,ctx: {},token: CancellationToken): ProviderResult<Command>;}namespacewindow{/** * Register a new `ExternalUriOpener`. * * When a uri is about to be opened, an `onUriOpen:SCHEME` activation event is fired. * * @param schemes List of uri schemes the opener is triggered for. Currently only `http` * and `https` are supported. * @param opener Opener to register. * * @returns Disposable that unregisters the opener. */exportfunctionregisterExternalUriOpener(schemes: readonlystring[],opener: ExternalUriOpener,): Disposable;}
Main changes:
Renamed to ExternalUriOpener to make it clear the opener only applies to uris that VS Code itself does not handle
The provider now registers for a specific set of schemes
The openExternalUri method now returns a command. If there are multiple openers, we show the command title in a quick pick so that the user can select which opener to use
This is something I'd like to take advantage of for the port auto forwarding notification. The idea would be that instead of clicking on the button in the notification to open in the browser, we could instead use that button to open a "browser preview".
Taking this even further, once we add a way to specify additional properties for ports in settings, we can make one of the additional properties an "on forward" action. This action could be one of several options: open in browser, open in "browser preview", do nothing, etc..
Activity
connor4312 commentedon Oct 26, 2020
I talked with Kai about the "debugger launch" scenario in my 1:1 last week. In my specific scenario, I think the requirements you have are sufficient. Most of the potential fancy stuff I do would be driven OOB, e.g. by the mirroring http server providing the debugging and communication pipe.
Adding proposed external uri opener API
mjbvz commentedon Dec 16, 2020
Johannes Rieken (@jrieken) Alexandru Dima (@alexdima) Here's the current version of the API based on our discussion earlier:
Main changes:
Renamed to
ExternalUriOpenerto make it clear the opener only applies to uris that VS Code itself does not handleThe provider now registers for a specific set of schemes
The
openExternalUrimethod now returns a command. If there are multiple openers, we show the command title in a quick pick so that the user can select which opener to usealexr00 commentedon Dec 16, 2020
This is something I'd like to take advantage of for the port auto forwarding notification. The idea would be that instead of clicking on the button in the notification to open in the browser, we could instead use that button to open a "browser preview".
Taking this even further, once we add a way to specify additional properties for ports in settings, we can make one of the additional properties an "on forward" action. This action could be one of several options: open in browser, open in "browser preview", do nothing, etc..
mjbvz commentedon Jan 7, 2021
20 remaining items