add kernel service and add extension host logic for it

This commit is contained in:
Johannes Rieken
2021-04-06 15:46:01 +02:00
parent ce275c6c0c
commit b47fb7a275
8 changed files with 418 additions and 0 deletions

View File

@@ -62,6 +62,7 @@ import { WorkspaceTrustRequestOptions, WorkspaceTrustStateChangeEvent } from 'vs
import { ISerializableEnvironmentVariableCollection } from 'vs/workbench/contrib/terminal/common/environmentVariable';
import { IShellLaunchConfig, IShellLaunchConfigDto, ITerminalDimensions, ITerminalEnvironment, ITerminalLaunchError } from 'vs/platform/terminal/common/terminal';
import { ITerminalProfile } from 'vs/workbench/contrib/terminal/common/terminal';
import { NotebookSelector } from 'vs/workbench/contrib/notebook/common/notebookSelector';
export interface IEnvironment {
isExtensionDevelopmentDebug: boolean;
@@ -898,6 +899,26 @@ export interface MainThreadNotebookDocumentsShape extends IDisposable {
$applyEdits(resource: UriComponents, edits: IImmediateCellEditOperation[], computeUndoRedo?: boolean): Promise<void>;
}
export interface INotebookKernelDto2 {
id: string;
selector: NotebookSelector;
label: string;
executeCommand: ICommandDto;
interruptCommand?: ICommandDto;
detail?: string;
description?: string;
isPreferred?: boolean;
supportedLanguages: string[];
hasExecutionOrder?: boolean;
preloads?: URI[];
}
export interface MainThreadNotebookKernelsShape extends IDisposable {
$addKernel(handle: number, data: INotebookKernelDto2): void;
$updateKernel(handle: number, data: Partial<INotebookKernelDto2>): void;
$removeKernel(handle: number): void;
}
export interface MainThreadUrlsShape extends IDisposable {
$registerUriHandler(handle: number, extensionId: ExtensionIdentifier): Promise<void>;
$unregisterUriHandler(handle: number): Promise<void>;
@@ -1926,6 +1947,10 @@ export interface ExtHostNotebookEditorsShape {
$acceptEditorViewColumns(data: INotebookEditorViewColumnInfo): void;
}
export interface ExtHostNotebookKernelsShape {
$acceptSelection(handle: number, value: boolean): void;
}
export interface ExtHostStorageShape {
$acceptValue(shared: boolean, key: string, value: object | undefined): void;
}
@@ -2029,6 +2054,7 @@ export const MainContext = {
MainThreadNotebook: createMainId<MainThreadNotebookShape>('MainThreadNotebook'),
MainThreadNotebookDocuments: createMainId<MainThreadNotebookDocumentsShape>('MainThreadNotebookDocumentsShape'),
MainThreadNotebookEditors: createMainId<MainThreadNotebookEditorsShape>('MainThreadNotebookEditorsShape'),
MainThreadNotebookKernels: createMainId<MainThreadNotebookKernelsShape>('MainThreadNotebookKernels'),
MainThreadTheming: createMainId<MainThreadThemingShape>('MainThreadTheming'),
MainThreadTunnelService: createMainId<MainThreadTunnelServiceShape>('MainThreadTunnelService'),
MainThreadTimeline: createMainId<MainThreadTimelineShape>('MainThreadTimeline'),
@@ -2075,6 +2101,7 @@ export const ExtHostContext = {
ExtHostOutputService: createMainId<ExtHostOutputServiceShape>('ExtHostOutputService'),
ExtHosLabelService: createMainId<ExtHostLabelServiceShape>('ExtHostLabelService'),
ExtHostNotebook: createMainId<ExtHostNotebookShape>('ExtHostNotebook'),
ExtHostNotebookKernels: createMainId<ExtHostNotebookKernelsShape>('ExtHostNotebookKernels'),
ExtHostTheming: createMainId<ExtHostThemingShape>('ExtHostTheming'),
ExtHostTunnelService: createMainId<ExtHostTunnelServiceShape>('ExtHostTunnelService'),
ExtHostAuthentication: createMainId<ExtHostAuthenticationShape>('ExtHostAuthentication'),