Rework workbench.action.searchEditor.deleteResultBlock into search.searchEditor.action.deleteFileResults

closes #100859
This commit is contained in:
Jackson Kearl
2020-07-08 10:33:15 -07:00
parent d417925ed3
commit 5fc4d714d7
2 changed files with 24 additions and 13 deletions

View File

@@ -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,

View File

@@ -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({