mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-19 16:18:58 +01:00
Implement interactive session provider api (#175810)
Implement interactive session provider
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user