Ask all local extension hosts to resolve canonical URIs

This commit is contained in:
Alex Dima
2022-03-11 10:04:00 +01:00
parent d09791e6ae
commit f6ad20b09a
7 changed files with 49 additions and 28 deletions

View File

@@ -753,12 +753,13 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme
}
}
public async $getCanonicalURI(remoteAuthority: string, uriComponents: UriComponents): Promise<UriComponents> {
public async $getCanonicalURI(remoteAuthority: string, uriComponents: UriComponents): Promise<UriComponents | null> {
this._logService.info(`$getCanonicalURI invoked for authority (${getRemoteAuthorityPrefix(remoteAuthority)})`);
const { authorityPrefix, resolver } = await this._activateAndGetResolver(remoteAuthority);
const { resolver } = await this._activateAndGetResolver(remoteAuthority);
if (!resolver) {
throw new Error(`Cannot get canonical URI because no remote extension is installed to resolve ${authorityPrefix}`);
// Return `null` if no resolver for `remoteAuthority` is found.
return null;
}
const uri = URI.revive(uriComponents);