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:
Matt Bierner
2021-01-06 19:04:43 -08:00
parent bdf57b45ce
commit e2c305f3a3
9 changed files with 76 additions and 34 deletions

View File

@@ -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;
}