Skip to content

Commit

Permalink
fix kernel autobind for on startup opened notebooks (#13598)
Browse files Browse the repository at this point in the history
Signed-off-by: Jonah Iden <[email protected]>
  • Loading branch information
jonah-iden authored Apr 17, 2024
1 parent d99f81b commit fea794f
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,16 @@ export class NotebookKernelsMainImpl implements NotebookKernelsMain {
}
}(handle, data, this.languageService);

// this is for when a kernel is bound to a notebook while being registered
const autobindListener = this.notebookKernelService.onDidChangeSelectedKernel(e => {
if (e.newKernel === kernel.id) {
this.proxy.$acceptNotebookAssociation(handle, e.notebook.toComponents(), true);
}
});

const registration = this.notebookKernelService.registerKernel(kernel);
this.kernels.set(handle, [kernel, registration]);

autobindListener.dispose();
}

$updateKernel(handle: number, data: Partial<NotebookKernelDto>): void {
Expand Down

0 comments on commit fea794f

Please sign in to comment.