Skip to content

Commit

Permalink
moved to kernel menu
Browse files Browse the repository at this point in the history
  • Loading branch information
markellekelly committed Jan 16, 2020
1 parent 1fbc8d5 commit 804d0f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
3 changes: 3 additions & 0 deletions packages/mainmenu-extension/src/index.ts
Expand Up @@ -71,6 +71,8 @@ export namespace CommandIDs {

export const restartKernelAndClear = 'kernelmenu:restart-and-clear';

export const restartAndRunToSelected = 'notebook:restart-and-run-to-selected';

export const changeKernel = 'kernelmenu:change';

export const shutdownKernel = 'kernelmenu:shutdown';
Expand Down Expand Up @@ -547,6 +549,7 @@ export function createKernelMenu(app: JupyterFrontEnd, menu: KernelMenu): void {
const restartGroup = [
CommandIDs.restartKernel,
CommandIDs.restartKernelAndClear,
CommandIDs.restartAndRunToSelected,
CommandIDs.restartAndRunAll
].map(command => {
return { command };
Expand Down
13 changes: 3 additions & 10 deletions packages/notebook-extension/src/index.ts
Expand Up @@ -101,6 +101,8 @@ namespace CommandIDs {

export const restartClear = 'notebook:restart-clear-output';

export const restartAndRunToSelected = 'notebook:restart-and-run-to-selected';

export const restartRunAll = 'notebook:restart-run-all';

export const reconnectToKernel = 'notebook:reconnect-to-kernel';
Expand Down Expand Up @@ -133,8 +135,6 @@ namespace CommandIDs {

export const runAllBelow = 'notebook:run-all-below';

export const restartAndRunToSelected = 'notebook:restart-and-run-to-selected';

export const renderAllMarkdown = 'notebook:render-all-markdown';

export const toCode = 'notebook:change-cell-to-code';
Expand Down Expand Up @@ -1255,7 +1255,6 @@ function addCommands(
label: 'Restart Kernel and Run up to Selected Cell…',
execute: args => {
const current = getCurrent(args);

if (current) {
const { context, content } = current;
return sessionDialogs!
Expand All @@ -1266,7 +1265,7 @@ function addCommands(
content,
context.sessionContext
).then(executed => {
if (executed) {
if (executed || content.activeCellIndex === 0) {
void NotebookActions.run(content, context.sessionContext);
}
});
Expand Down Expand Up @@ -2239,11 +2238,6 @@ function populateMenus(
return { command };
});

// Add a restart and run to group to the run menu.
const restartRunGroup = [CommandIDs.restartAndRunToSelected].map(command => {
return { command };
});

// Add commands to the application edit menu.
const undoCellActionGroup = [
CommandIDs.undoCellAction,
Expand Down Expand Up @@ -2287,7 +2281,6 @@ function populateMenus(
mainMenu.runMenu.addGroup(runExtras, 10);
mainMenu.runMenu.addGroup(runAboveBelowGroup, 11);
mainMenu.runMenu.addGroup(renderAllMarkdown, 12);
mainMenu.runMenu.addGroup(restartRunGroup, 13);

// Add kernel information to the application help menu.
mainMenu.helpMenu.kernelUsers.add({
Expand Down

0 comments on commit 804d0f4

Please sign in to comment.