From e9d29981143fbf79d387b8511519b67ab3fb437f Mon Sep 17 00:00:00 2001 From: Steven Guh Date: Tue, 15 Jun 2021 21:18:57 -0700 Subject: [PATCH] Rename command describeBindings to searchBindings --- package.json | 6 +++--- src/commandRelay.ts | 14 +++++++------- src/constants.ts | 4 ++-- src/extension.ts | 2 +- src/menu/whichKeyMenu.ts | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 61560e4..dc89a79 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ }, { "key": "ctrl+h", - "command": "whichkey.describeBindings", + "command": "whichkey.searchBindings", "when": "whichkeyVisible" } ], @@ -269,9 +269,9 @@ }, { "key": "?", - "name": "Describe keybindings", + "name": "Search keybindings", "type": "command", - "command": "whichkey.describeBindings" + "command": "whichkey.searchBindings" }, { "key": ".", diff --git a/src/commandRelay.ts b/src/commandRelay.ts index 93cf6fa..a284995 100644 --- a/src/commandRelay.ts +++ b/src/commandRelay.ts @@ -8,12 +8,12 @@ export interface KeybindingArgs { export class CommandRelay { private keyEmitter: EventEmitter; private zenModeEmitter: EventEmitter; - private describeBindingEmitter: EventEmitter; + private searchBindingsEmitter: EventEmitter; constructor() { this.keyEmitter = new EventEmitter(); this.zenModeEmitter = new EventEmitter(); - this.describeBindingEmitter = new EventEmitter(); + this.searchBindingsEmitter = new EventEmitter(); } triggerKey(key: string | KeybindingArgs): void { @@ -35,17 +35,17 @@ export class CommandRelay { return this.zenModeEmitter.event; } - describeBindings(): void { - this.describeBindingEmitter.fire(); + searchBindings(): void { + this.searchBindingsEmitter.fire(); } - get onDescribeBindings(): Event { - return this.describeBindingEmitter.event; + get onDidSearchBindings(): Event { + return this.searchBindingsEmitter.event; } dispose(): void { this.keyEmitter.dispose(); this.zenModeEmitter.dispose(); - this.describeBindingEmitter.dispose(); + this.searchBindingsEmitter.dispose(); } } diff --git a/src/constants.ts b/src/constants.ts index 7226383..79caec4 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -12,7 +12,7 @@ export enum CommandKey { Show = 'show', Register = 'register', Trigger = 'triggerKey', - DescribeBindings = 'describeBindings', + SearchBindings = 'searchBindings', ShowTransient = 'showTransient', RepeatRecent = 'repeatRecent', RepeatMostRecent = 'repeatMostRecent', @@ -44,7 +44,7 @@ export const Commands = { Show: `${contributePrefix}.${CommandKey.Show}`, Register: `${contributePrefix}.${CommandKey.Register}`, Trigger: `${contributePrefix}.${CommandKey.Trigger}`, - DescribeBindings: `${contributePrefix}.${CommandKey.DescribeBindings}`, + SearchBindings: `${contributePrefix}.${CommandKey.SearchBindings}`, ShowTransient: `${contributePrefix}.${CommandKey.ShowTransient}`, RepeatRecent: `${contributePrefix}.${CommandKey.RepeatRecent}`, RepeatMostRecent: `${contributePrefix}.${CommandKey.RepeatMostRecent}`, diff --git a/src/extension.ts b/src/extension.ts index c030192..a58c2bd 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -25,7 +25,7 @@ export function activate(context: ExtensionContext): void { commands.registerCommand(Commands.Trigger, cmdRelay.triggerKey, cmdRelay), commands.registerCommand(Commands.Register, registry.register, registry), commands.registerCommand(Commands.Show, registry.show, registry), - commands.registerCommand(Commands.DescribeBindings, cmdRelay.describeBindings, cmdRelay), + commands.registerCommand(Commands.SearchBindings, cmdRelay.searchBindings, cmdRelay), commands.registerCommand(Commands.ShowTransient, showTransientMenu.bind(registry, statusBar, cmdRelay)), commands.registerCommand(Commands.RepeatRecent, registry.repeatRecent, registry), commands.registerCommand(Commands.RepeatMostRecent, registry.repeatMostRecent, registry), diff --git a/src/menu/whichKeyMenu.ts b/src/menu/whichKeyMenu.ts index ed23e8e..6dad431 100644 --- a/src/menu/whichKeyMenu.ts +++ b/src/menu/whichKeyMenu.ts @@ -22,7 +22,7 @@ class WhichKeyMenu extends BaseWhichKeyMenu{ constructor(statusBar: StatusBar, cmdRelay: CommandRelay, repeater?: WhichKeyRepeater, delay = 0) { super(cmdRelay); this.disposables.push( - cmdRelay.onDescribeBindings(this.onDescribeBindings, this) + cmdRelay.onDidSearchBindings(this.onDidSearchBindings, this) ); this.statusBar = statusBar; this.repeater = repeater; @@ -30,9 +30,9 @@ class WhichKeyMenu extends BaseWhichKeyMenu{ this.itemHistory = []; } - private onDescribeBindings(): Promise { + private onDidSearchBindings(): Promise { const items = createDescBindItems(this.items, this.itemHistory); - return showDescBindMenu(items, "Describe Keybindings"); + return showDescBindMenu(items, "Search Keybindings"); } protected async onItemNotMatch(value: string): Promise {