diff --git a/src/vs/workbench/contrib/search/browser/search.contribution.ts b/src/vs/workbench/contrib/search/browser/search.contribution.ts index b7ec86c1b32..196aa1fa4db 100644 --- a/src/vs/workbench/contrib/search/browser/search.contribution.ts +++ b/src/vs/workbench/contrib/search/browser/search.contribution.ts @@ -81,19 +81,6 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ } }); -KeybindingsRegistry.registerCommandAndKeybindingRule({ - id: 'workbench.action.searchEditor.deleteResultBlock', - weight: KeybindingWeight.WorkbenchContrib, - when: SearchEditorConstants.InSearchEditor, - primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Backspace, - handler: accessor => { - const contextService = accessor.get(IContextKeyService).getContext(document.activeElement); - if (contextService.getValue(SearchEditorConstants.InSearchEditor.serialize())) { - (accessor.get(IEditorService).activeEditorPane as SearchEditor).deleteResultBlock(); - } - } -}); - KeybindingsRegistry.registerCommandAndKeybindingRule({ id: Constants.FocusSearchFromResults, weight: KeybindingWeight.WorkbenchContrib, diff --git a/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.ts b/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.ts index 85310f85300..f717b4934e9 100644 --- a/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.ts +++ b/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.ts @@ -236,6 +236,30 @@ const openArgDescription = { }] } as const; +registerAction2(class extends Action2 { + constructor() { + super({ + id: 'search.searchEditor.action.deleteFileResults', + title: localize('searchEditor.deleteResultBlock', "Delete File Results"), + keybinding: { + weight: KeybindingWeight.EditorContrib, + when: SearchEditorConstants.InSearchEditor, + primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Backspace, + }, + precondition: SearchEditorConstants.InSearchEditor, + category, + f1: true, + }); + } + + async run(accessor: ServicesAccessor) { + const contextService = accessor.get(IContextKeyService).getContext(document.activeElement); + if (contextService.getValue(SearchEditorConstants.InSearchEditor.serialize())) { + (accessor.get(IEditorService).activeEditorPane as SearchEditor).deleteResultBlock(); + } + } +}); + registerAction2(class extends Action2 { constructor() { super({