Implement interactive session provider api (#175810)

Implement interactive session provider
This commit is contained in:
Rob Lourens
2023-03-01 17:47:18 -05:00
committed by GitHub
parent 61a2399c23
commit 825e84e144
30 changed files with 3178 additions and 13 deletions

View File

@@ -97,6 +97,7 @@ import { IExtHostLocalizationService } from 'vs/workbench/api/common/extHostLoca
import { EditSessionIdentityMatch } from 'vs/platform/workspace/common/editSessions';
import { ExtHostProfileContentHandlers } from 'vs/workbench/api/common/extHostProfileContentHandler';
import { ExtHostQuickDiff } from 'vs/workbench/api/common/extHostQuickDiff';
import { ExtHostInteractiveSession } from 'vs/workbench/api/common/extHostInteractiveSession';
export interface IExtensionRegistries {
mine: ExtensionDescriptionRegistry;
@@ -191,6 +192,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
const extHostUriOpeners = rpcProtocol.set(ExtHostContext.ExtHostUriOpeners, new ExtHostUriOpeners(rpcProtocol));
const extHostProfileContentHandlers = rpcProtocol.set(ExtHostContext.ExtHostProfileContentHandlers, new ExtHostProfileContentHandlers(rpcProtocol));
rpcProtocol.set(ExtHostContext.ExtHostInteractive, new ExtHostInteractive(rpcProtocol, extHostNotebook, extHostDocumentsAndEditors, extHostCommands, extHostLogService));
const extHostInteractiveSession = rpcProtocol.set(ExtHostContext.ExtHostInteractiveSession, new ExtHostInteractiveSession(rpcProtocol, extHostLogService));
// Check that no named customers are missing
const expected = Object.values<ProxyIdentifier<any>>(ExtHostContext);
@@ -1208,6 +1210,22 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
}
};
// namespace: interactive
const interactive: typeof vscode.interactive = {
// IMPORTANT
// this needs to be updated whenever the API proposal changes
_version: 1,
registerInteractiveSessionProvider(id: string, provider: vscode.InteractiveSessionProvider) {
checkProposedApiEnabled(extension, 'interactive');
return extHostInteractiveSession.registerInteractiveSessionProvider(extension, id, provider);
},
addInteractiveRequest(context: vscode.InteractiveSessionRequestArgs) {
checkProposedApiEnabled(extension, 'interactive');
return extHostInteractiveSession.addInteractiveSessionRequest(context);
}
};
return <typeof vscode>{
version: initData.version,
// namespaces
@@ -1217,6 +1235,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
debug,
env,
extensions,
interactive,
l10n,
languages,
notebooks,