Skip to content

Commit

Permalink
Use suggested kernel if we have only one kernel (#136548)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Nov 10, 2021
1 parent 000f04e commit f87615d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class NotebookEditorKernelManager extends Disposable {
getSelectedOrSuggestedKernel(notebook: INotebookTextModel): INotebookKernel | undefined {
// returns SELECTED or the ONLY available kernel
const info = this._notebookKernelService.getMatchingKernel(notebook);
return info.selected ?? info.suggestions[0];
return info.selected ?? (info.all.length === 1 ? info.all[0] : undefined);
}

async executeNotebookCells(notebook: INotebookTextModel, cells: Iterable<ICellViewModel>): Promise<void> {
Expand Down

0 comments on commit f87615d

Please sign in to comment.