add high priority to void keybinds

This commit is contained in:
Andrew Pareles 2025-01-15 19:24:08 -08:00
parent b9dba7d08b
commit 7dec57ae04
4 changed files with 16 additions and 5 deletions

View file

@ -64,7 +64,8 @@ export const enum KeybindingWeight {
EditorContrib = 100,
WorkbenchContrib = 200,
BuiltinExtension = 300,
ExternalExtension = 400
ExternalExtension = 400,
VoidExtension = 500, // Void - must trump any external extension
}
export interface ICommandAndKeybindingRule extends IKeybindingRule {

View file

@ -12,6 +12,7 @@ import { ICodeEditorService } from '../../../../editor/browser/services/codeEdit
import { IInlineDiffsService } from './inlineDiffsService.js';
import { roundRangeToLines } from './sidebarActions.js';
import { VOID_CTRL_K_ACTION_ID } from './actionIDs.js';
import { localize2 } from '../../../../nls.js';
export type QuickEditPropsType = {
@ -37,10 +38,11 @@ registerAction2(class extends Action2 {
) {
super({
id: VOID_CTRL_K_ACTION_ID,
title: 'Void: Quick Edit',
f1: true,
title: localize2('voidQuickEditAction', 'Void: Quick Edit'),
keybinding: {
primary: KeyMod.CtrlCmd | KeyCode.KeyK,
weight: KeybindingWeight.BuiltinExtension,
weight: KeybindingWeight.VoidExtension,
}
});
}

View file

@ -625,7 +625,7 @@ export const SidebarChat = () => {
{/* text input */}
<VoidInputBox2
className='min-h-[81px] p-1'
placeholder={`${keybindingString} to select. Enter instructions...`}
placeholder={`${keybindingString ? `${keybindingString} to select. ` : ''}Enter instructions...`}
onChangeText={useCallback((newStr: string) => { setInstructionsAreEmpty(!newStr) }, [setInstructionsAreEmpty])}
onKeyDown={(e) => {
if (e.key === 'Enter' && !e.shiftKey) {

View file

@ -153,7 +153,15 @@ registerAction2(class extends Action2 {
registerAction2(class extends Action2 {
constructor() {
super({ id: VOID_CTRL_L_ACTION_ID, title: 'Void: Press Ctrl+L', keybinding: { primary: KeyMod.CtrlCmd | KeyCode.KeyL, weight: KeybindingWeight.BuiltinExtension } });
super({
id: VOID_CTRL_L_ACTION_ID,
f1: true,
title: localize2('voidCtrlL', 'Void: Add Select to Chat'),
keybinding: {
primary: KeyMod.CtrlCmd | KeyCode.KeyL,
weight: KeybindingWeight.VoidExtension
}
});
}
async run(accessor: ServicesAccessor): Promise<void> {
const commandService = accessor.get(ICommandService)