enable core interrupt command for IW

This commit is contained in:
aamunger 2023-03-31 11:43:47 -07:00
parent 829e0b3d06
commit 17487d6378
No known key found for this signature in database
GPG key ID: F2CA0C6303FC6B74
2 changed files with 11 additions and 2 deletions

View file

@ -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';
@ -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) {

View file

@ -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'
}
]
});