Skip to content

Commit 2fad3d9

Browse files
committed
Do not interrupt if there are no affected cells
1 parent beed9ac commit 2fad3d9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,10 @@ class NotebookExecutionListeners extends Disposable {
306306
if (kernel) {
307307
const implementsInterrupt = kernel.implementsInterrupt;
308308
const handlesToCancel = implementsInterrupt ? [...executingDeletedHandles] : [...executingDeletedHandles, ...pendingDeletedHandles];
309-
this._logService.debug(`NotebookExecution#onWillAddRemoveCells, ${JSON.stringify([...handlesToCancel])}`);
310-
kernel.cancelNotebookCellExecution(this._notebookModel.uri, handlesToCancel);
309+
if (handlesToCancel.length) {
310+
this._logService.debug(`NotebookExecution#onWillAddRemoveCells, ${JSON.stringify([...handlesToCancel])}`);
311+
kernel.cancelNotebookCellExecution(this._notebookModel.uri, handlesToCancel);
312+
}
311313
}
312314
}
313315
}

0 commit comments

Comments
 (0)