diff --git a/src/vs/workbench/api/browser/mainThreadNotebook.ts b/src/vs/workbench/api/browser/mainThreadNotebook.ts index c71dec330a5..a922b7ad000 100644 --- a/src/vs/workbench/api/browser/mainThreadNotebook.ts +++ b/src/vs/workbench/api/browser/mainThreadNotebook.ts @@ -172,6 +172,7 @@ export class MainThreadNotebooks implements MainThreadNotebookShape { preloads: dto.preloads?.map(u => URI.revive(u)), supportedLanguages: dto.supportedLanguages, implementsInterrupt: dto.implementsInterrupt, + implementsExecutionOrder: true, // todo@jrieken this is temporary and for the OLD API only resolve: (uri: URI, editorId: string, token: CancellationToken): Promise => { this._logService.debug('MainthreadNotebooks.resolveNotebookKernel', uri.path, dto.friendlyId); return this._proxy.$resolveNotebookKernel(handle, editorId, uri, dto.friendlyId, token); diff --git a/src/vs/workbench/api/browser/mainThreadNotebookKernels.ts b/src/vs/workbench/api/browser/mainThreadNotebookKernels.ts index 41e6250ba98..6eab992285f 100644 --- a/src/vs/workbench/api/browser/mainThreadNotebookKernels.ts +++ b/src/vs/workbench/api/browser/mainThreadNotebookKernels.ts @@ -28,7 +28,7 @@ abstract class MainThreadKernel implements INotebookKernel2 { detail?: string; isPreferred?: boolean; supportedLanguages: string[]; - hasExecutionOrder: boolean; + implementsExecutionOrder: boolean; localResourceRoot: URI; preloads?: URI[]; @@ -42,7 +42,7 @@ abstract class MainThreadKernel implements INotebookKernel2 { this.description = data.description; this.isPreferred = data.isPreferred; this.supportedLanguages = data.supportedLanguages; - this.hasExecutionOrder = data.hasExecutionOrder ?? false; + this.implementsExecutionOrder = data.hasExecutionOrder ?? false; this.localResourceRoot = URI.revive(data.extensionLocation); this.preloads = data.preloads && data.preloads.map(u => URI.revive(u)); } @@ -67,7 +67,7 @@ abstract class MainThreadKernel implements INotebookKernel2 { event.supportedLanguages = true; } if (data.hasExecutionOrder !== undefined) { - this.hasExecutionOrder = data.hasExecutionOrder; + this.implementsExecutionOrder = data.hasExecutionOrder; event.hasExecutionOrder = true; } this._onDidChange.fire(event); diff --git a/src/vs/workbench/api/common/extHostNotebookKernels.ts b/src/vs/workbench/api/common/extHostNotebookKernels.ts index f97a0129435..2230f04dbeb 100644 --- a/src/vs/workbench/api/common/extHostNotebookKernels.ts +++ b/src/vs/workbench/api/common/extHostNotebookKernels.ts @@ -48,7 +48,8 @@ export class ExtHostNotebookKernels implements ExtHostNotebookKernelsShape { extensionLocation: extension.extensionLocation, label: options.label, supportedLanguages: options.supportedLanguages, - supportsInterrupt: Boolean(options.interruptHandler) + supportsInterrupt: Boolean(options.interruptHandler), + hasExecutionOrder: options.hasExecutionOrder, }; this._proxy.$addKernel(handle, data); diff --git a/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts b/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts index e948c5f84e8..7a80ee2eb97 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts @@ -859,7 +859,7 @@ export class CodeCellRenderer extends AbstractCellRenderer implements IListRende } private updateExecutionOrder(metadata: NotebookCellMetadata, templateData: CodeCellRenderTemplate): void { - if (metadata.hasExecutionOrder) { + if (this.notebookEditor.activeKernel?.implementsExecutionOrder) { const executionOrderLabel = typeof metadata.executionOrder === 'number' ? `[${metadata.executionOrder}]` : '[ ]'; diff --git a/src/vs/workbench/contrib/notebook/common/notebookCommon.ts b/src/vs/workbench/contrib/notebook/common/notebookCommon.ts index 9d79ba59146..185935267b7 100644 --- a/src/vs/workbench/contrib/notebook/common/notebookCommon.ts +++ b/src/vs/workbench/contrib/notebook/common/notebookCommon.ts @@ -762,6 +762,7 @@ export interface INotebookKernel { preloads?: URI[]; supportedLanguages?: string[] implementsInterrupt?: boolean; + implementsExecutionOrder?: boolean; resolve(uri: URI, editorId: string, token: CancellationToken): Promise; executeNotebookCellsRequest(uri: URI, ranges: ICellRange[]): Promise; diff --git a/src/vs/workbench/contrib/notebook/common/notebookKernelService.ts b/src/vs/workbench/contrib/notebook/common/notebookKernelService.ts index f6b37d03e99..d506588e300 100644 --- a/src/vs/workbench/contrib/notebook/common/notebookKernelService.ts +++ b/src/vs/workbench/contrib/notebook/common/notebookKernelService.ts @@ -33,7 +33,7 @@ export interface INotebookKernel2 { detail?: string; isPreferred?: boolean; supportedLanguages: string[]; - hasExecutionOrder: boolean; + implementsExecutionOrder: boolean; implementsInterrupt: boolean; localResourceRoot: URI; diff --git a/src/vs/workbench/contrib/notebook/common/notebookKernelServiceImpl.ts b/src/vs/workbench/contrib/notebook/common/notebookKernelServiceImpl.ts index a645f210168..0ceeb82420f 100644 --- a/src/vs/workbench/contrib/notebook/common/notebookKernelServiceImpl.ts +++ b/src/vs/workbench/contrib/notebook/common/notebookKernelServiceImpl.ts @@ -105,6 +105,7 @@ class KernelAdaptorBridge implements IWorkbenchContribution { extensionLocation: kernel.localResourceRoot, supportedLanguages: kernel.supportedLanguages, implementsInterrupt: kernel.implementsInterrupt, + implementsExecutionOrder: kernel.implementsExecutionOrder, extension: kernel.extensionId, async resolve() { }, async executeNotebookCellsRequest(uri: URI, ranges: ICellRange[]): Promise { kernel.executeCells(uri, ranges); },