提交 be44e409 编写于 作者: R rebornix

avoid conflict between new and legacy kernel

上级 05144a3d
......@@ -125,7 +125,7 @@ suite('Notebook API tests', () => {
await firstEditorClose;
});
test('editor open/close event', async function () {
test('editor open/close event 2', async function () {
const resource = vscode.Uri.file(join(vscode.workspace.rootPath || '', './first.vsctestnb'));
let count = 0;
const disposables: vscode.Disposable[] = [];
......
......@@ -1151,8 +1151,8 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
if (this._activeKernel) {
// TODO@rebornix temp any cast, should be removed once we remove legacy kernel support
if ((this._activeKernel as any).executeNotebook) {
await (this._activeKernel as INotebookKernelInfo2).executeNotebook(this._notebookViewModel!.uri, undefined, tokenSource.token);
if ((this._activeKernel as INotebookKernelInfo2).executeNotebookCell) {
await (this._activeKernel as INotebookKernelInfo2).executeNotebookCell!(this._notebookViewModel!.uri, undefined, tokenSource.token);
} else {
await this.notebookService.executeNotebook2(this._notebookViewModel!.viewType, this._notebookViewModel!.uri, this._activeKernel.id, tokenSource.token);
}
......@@ -1206,8 +1206,8 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
if (this._activeKernel) {
// TODO@rebornix temp any cast, should be removed once we remove legacy kernel support
if ((this._activeKernel as any).executeNotebook) {
await (this._activeKernel as INotebookKernelInfo2).executeNotebook(this._notebookViewModel!.uri, cell.handle, tokenSource.token);
if ((this._activeKernel as INotebookKernelInfo2).executeNotebookCell) {
await (this._activeKernel as INotebookKernelInfo2).executeNotebookCell!(this._notebookViewModel!.uri, cell.handle, tokenSource.token);
} else {
return await this.notebookService.executeNotebookCell2(viewType, notebookUri, cell.handle, this._activeKernel.id, tokenSource.token);
......
......@@ -648,7 +648,7 @@ export interface INotebookKernelInfoDto2 {
export interface INotebookKernelInfo2 extends INotebookKernelInfoDto2 {
resolve(uri: URI, editorId: string): Promise<void>;
executeNotebook(uri: URI, handle: number | undefined, token: CancellationToken): Promise<void>;
executeNotebookCell?(uri: URI, handle: number | undefined, token: CancellationToken): Promise<void>;
}
export interface INotebookKernelProvider {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册