mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 17:48:56 +01:00
Allow registering additional external uri openers
This change moves the extension uri opener contribution point to instead use the internal `IExternalOpener` api instead of the more generic `IOpener` api. This is required since external uri openers should see the resolved uri that has gone through port forwarding, not the raw uri that the user clicked on
This commit is contained in:
@@ -49,7 +49,7 @@ export class ExtHostUriOpeners implements ExtHostUriOpenersShape {
|
||||
});
|
||||
}
|
||||
|
||||
async $openUri(uriComponents: UriComponents, token: CancellationToken): Promise<boolean> {
|
||||
async $openUri(uriComponents: UriComponents, ctx: { originalUri: UriComponents }, token: CancellationToken): Promise<boolean> {
|
||||
const uri = URI.revive(uriComponents);
|
||||
|
||||
const promises = Array.from(this._openers.values()).map(async ({ schemes, opener }): Promise<vscode.Command | undefined> => {
|
||||
@@ -58,7 +58,10 @@ export class ExtHostUriOpeners implements ExtHostUriOpenersShape {
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await opener.openExternalUri(uri, {}, token);
|
||||
const result = await opener.openExternalUri(uri, {
|
||||
originalUri: URI.revive(ctx.originalUri),
|
||||
}, token);
|
||||
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user