mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-30 01:25:38 -05:00
Restart kernel initial implementation (#18835)
* Restart kernel initial implementation * Update notebook extension TestKernel * PR comments
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user