Adding proposed external uri opener API

For #109277
This commit is contained in:
Matt Bierner
2020-12-15 16:15:15 -08:00
parent 542670762f
commit 6d3c2e6835
7 changed files with 228 additions and 3 deletions

View File

@@ -82,6 +82,7 @@ import { ExtHostWebviewPanels } from 'vs/workbench/api/common/extHostWebviewPane
import { ExtHostBulkEdits } from 'vs/workbench/api/common/extHostBulkEdits';
import { IExtHostFileSystemInfo } from 'vs/workbench/api/common/extHostFileSystemInfo';
import { ExtHostTesting } from 'vs/workbench/api/common/extHostTesting';
import { ExtHostUriOpeners } from 'vs/workbench/api/common/extHostUriOpener';
export interface IExtensionApiFactory {
(extension: IExtensionDescription, registry: ExtensionDescriptionRegistry, configProvider: ExtHostConfigProvider): typeof vscode;
@@ -154,6 +155,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
const extHostCustomEditors = rpcProtocol.set(ExtHostContext.ExtHostCustomEditors, new ExtHostCustomEditors(rpcProtocol, extHostDocuments, extensionStoragePaths, extHostWebviews, extHostWebviewPanels));
const extHostWebviewViews = rpcProtocol.set(ExtHostContext.ExtHostWebviewViews, new ExtHostWebviewViews(rpcProtocol, extHostWebviews));
const extHostTesting = rpcProtocol.set(ExtHostContext.ExtHostTesting, new ExtHostTesting(rpcProtocol, extHostDocumentsAndEditors, extHostWorkspace));
const extHostUriOpeners = rpcProtocol.set(ExtHostContext.ExtHostUriOpeners, new ExtHostUriOpeners(rpcProtocol, extHostCommands, extHostQuickOpen));
// Check that no named customers are missing
const expected: ProxyIdentifier<any>[] = values(ExtHostContext);
@@ -691,7 +693,11 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
showNotebookDocument(document, options?) {
checkProposedApiEnabled(extension);
return extHostNotebook.showNotebookDocument(document, options);
}
},
registerExternalUriOpener(schemes: readonly string[], opener: vscode.ExternalUriOpener) {
checkProposedApiEnabled(extension);
return extHostUriOpeners.registerUriOpener(extension.identifier, schemes, opener);
},
};
// namespace: workspace