Add new external uri opener service

This workbench service handles opening external uris. Unlike the core OpenerService, it also has logic for configuring a default opener and prompting if multiple openers are availble for a given uri
This commit is contained in:
Matt Bierner
2021-01-11 19:40:43 -08:00
parent 60e46eb875
commit 0227681492
10 changed files with 277 additions and 67 deletions

View File

@@ -801,12 +801,18 @@ export interface ExtHostUrlsShape {
}
export interface MainThreadUriOpenersShape extends IDisposable {
$registerUriOpener(handle: number, schemes: readonly string[]): Promise<void>;
$registerUriOpener(handle: number, schemes: readonly string[], extensionId: ExtensionIdentifier): Promise<void>;
$unregisterUriOpener(handle: number): Promise<void>;
}
export interface ExtHostUriOpener {
readonly extensionId: ExtensionIdentifier;
readonly commandId: number;
readonly title: string;
}
export interface ExtHostUriOpenersShape {
$getOpenersForUri(uri: UriComponents, token: CancellationToken): Promise<{ cacheId: number, openers: ReadonlyArray<{ id: number, title: string }> }>;
$getOpenersForUri(uri: UriComponents, token: CancellationToken): Promise<{ cacheId: number, openers: ReadonlyArray<ExtHostUriOpener> }>;
$openUri(id: ChainedCacheId, uri: UriComponents): Promise<void>;
$releaseOpener(cacheId: number): void;
}