Skip to content

Commit

Permalink
Merge pull request #178837 from amunger/aamunger/IWInterrupt
Browse files Browse the repository at this point in the history
enable core interrupt command for IW
  • Loading branch information
amunger committed Mar 31, 2023
2 parents 7e832ec + 076dca5 commit 80b3a43
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Expand Up @@ -10,7 +10,7 @@ import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { getNotebookEditorFromEditorPane, IActiveNotebookEditor, ICellViewModel, cellRangeToViewCells } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
import { NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_IS_ACTIVE_EDITOR, NOTEBOOK_KERNEL_COUNT, NOTEBOOK_KERNEL_SOURCE_COUNT } from 'vs/workbench/contrib/notebook/common/notebookContextKeys';
import { INTERACTIVE_WINDOW_IS_ACTIVE_EDITOR, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_IS_ACTIVE_EDITOR, NOTEBOOK_KERNEL_COUNT, NOTEBOOK_KERNEL_SOURCE_COUNT } from 'vs/workbench/contrib/notebook/common/notebookContextKeys';
import { ICellRange, isICellRange } from 'vs/workbench/contrib/notebook/common/notebookRange';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IEditorCommandsContext } from 'vs/workbench/common/editor';
Expand Down Expand Up @@ -116,7 +116,7 @@ export abstract class NotebookAction extends Action2 {
desc.f1 = false;
const f1Menu = {
id: MenuId.CommandPalette,
when: NOTEBOOK_IS_ACTIVE_EDITOR
when: ContextKeyExpr.or(NOTEBOOK_IS_ACTIVE_EDITOR, INTERACTIVE_WINDOW_IS_ACTIVE_EDITOR)
};

if (!desc.menu) {
Expand Down
Expand Up @@ -566,6 +566,15 @@ registerAction2(class InterruptNotebook extends CancelNotebook {
NOTEBOOK_INTERRUPTIBLE_KERNEL,
ContextKeyExpr.equals('config.notebook.globalToolbar', true)
)
},
{
id: MenuId.InteractiveToolbar,
when: ContextKeyExpr.and(
NOTEBOOK_HAS_RUNNING_CELL,
NOTEBOOK_INTERRUPTIBLE_KERNEL,
ContextKeyExpr.equals('resourceScheme', Schemas.vscodeInteractive)
),
group: 'navigation/execute'
}
]
});
Expand Down

0 comments on commit 80b3a43

Please sign in to comment.