Skip to content

Commit be44e40

Browse files
committed
avoid conflict between new and legacy kernel
1 parent 05144a3 commit be44e40

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

extensions/vscode-notebook-tests/src/notebook.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ suite('Notebook API tests', () => {
125125
await firstEditorClose;
126126
});
127127

128-
test('editor open/close event', async function () {
128+
test('editor open/close event 2', async function () {
129129
const resource = vscode.Uri.file(join(vscode.workspace.rootPath || '', './first.vsctestnb'));
130130
let count = 0;
131131
const disposables: vscode.Disposable[] = [];

src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,8 +1151,8 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
11511151

11521152
if (this._activeKernel) {
11531153
// TODO@rebornix temp any cast, should be removed once we remove legacy kernel support
1154-
if ((this._activeKernel as any).executeNotebook) {
1155-
await (this._activeKernel as INotebookKernelInfo2).executeNotebook(this._notebookViewModel!.uri, undefined, tokenSource.token);
1154+
if ((this._activeKernel as INotebookKernelInfo2).executeNotebookCell) {
1155+
await (this._activeKernel as INotebookKernelInfo2).executeNotebookCell!(this._notebookViewModel!.uri, undefined, tokenSource.token);
11561156
} else {
11571157
await this.notebookService.executeNotebook2(this._notebookViewModel!.viewType, this._notebookViewModel!.uri, this._activeKernel.id, tokenSource.token);
11581158
}
@@ -1206,8 +1206,8 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
12061206

12071207
if (this._activeKernel) {
12081208
// TODO@rebornix temp any cast, should be removed once we remove legacy kernel support
1209-
if ((this._activeKernel as any).executeNotebook) {
1210-
await (this._activeKernel as INotebookKernelInfo2).executeNotebook(this._notebookViewModel!.uri, cell.handle, tokenSource.token);
1209+
if ((this._activeKernel as INotebookKernelInfo2).executeNotebookCell) {
1210+
await (this._activeKernel as INotebookKernelInfo2).executeNotebookCell!(this._notebookViewModel!.uri, cell.handle, tokenSource.token);
12111211
} else {
12121212

12131213
return await this.notebookService.executeNotebookCell2(viewType, notebookUri, cell.handle, this._activeKernel.id, tokenSource.token);

src/vs/workbench/contrib/notebook/common/notebookCommon.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ export interface INotebookKernelInfoDto2 {
648648

649649
export interface INotebookKernelInfo2 extends INotebookKernelInfoDto2 {
650650
resolve(uri: URI, editorId: string): Promise<void>;
651-
executeNotebook(uri: URI, handle: number | undefined, token: CancellationToken): Promise<void>;
651+
executeNotebookCell?(uri: URI, handle: number | undefined, token: CancellationToken): Promise<void>;
652652
}
653653

654654
export interface INotebookKernelProvider {

0 commit comments

Comments
 (0)