Restart kernel initial implementation (#18835)

* Restart kernel initial implementation

* Update notebook extension TestKernel

* PR comments
This commit is contained in:
Chris LaFreniere
2022-03-29 12:56:52 -07:00
committed by GitHub
parent 8537a30996
commit af3d307d40
14 changed files with 95 additions and 14 deletions

View File

@@ -239,6 +239,24 @@ CommandsRegistry.registerCommand({
}
});
CommandsRegistry.registerCommand({
id: 'notebook.restartKernel',
handler: async (accessor: ServicesAccessor) => {
const editorService: IEditorService = accessor.get(IEditorService);
if (editorService.activeEditor instanceof NotebookInput) {
await editorService.activeEditor.notebookModel?.clientSession?.restart();
}
}
});
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
command: {
id: 'notebook.restartKernel',
title: localize('restartNotebookKernel', "Restart Notebook Kernel"),
},
when: ContextKeyExpr.and(ActiveEditorContext.isEqualTo(NotebookEditor.ID))
});
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
command: {
id: TOGGLE_TAB_FOCUS_COMMAND_ID,