Skip to content

Commit 1a5353e

Browse files
committed
fix(show-all-commands): apply scope and button set to quick pick
Show All Commands (Ctrl+Shift+;) ignored active scope and button set, always displaying default buttons regardless of configuration Applied same pattern as StatusBarManager and CommandTreeProvider using buttonSetManager.getButtonsForActiveSet() with configManager.getButtonsWithFallback() fallback logic
1 parent 8692516 commit 1a5353e

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

src/extension/main.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ describe("main", () => {
193193
expect(createShowAllCommandsCommand).toHaveBeenCalledWith(
194194
mockConfigReader,
195195
mockTerminalManager.executeCommand,
196-
mockQuickPickCreator
196+
mockQuickPickCreator,
197+
mockConfigManager,
198+
mockButtonSetManager
197199
);
198200
expect(commands.showAllCommandsCommand).toBe("mockDisposable");
199201
});

src/extension/main.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,13 @@ export const registerCommands = (
7777

7878
const showAllCommandsCommand = vscode.commands.registerCommand(
7979
"quickCommandButtons.showAllCommands",
80-
createShowAllCommandsCommand(configReader, terminalManager.executeCommand, quickPickCreator)
80+
createShowAllCommandsCommand(
81+
configReader,
82+
terminalManager.executeCommand,
83+
quickPickCreator,
84+
configManager,
85+
buttonSetManager
86+
)
8187
);
8288

8389
const openConfigCommand = vscode.commands.registerCommand(

src/internal/show-all-commands.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,20 @@ import * as vscode from "vscode";
22
import { MESSAGES } from "../shared/constants";
33
import { ConfigReader, QuickPickCreator, TerminalExecutor } from "./adapters";
44
import { createQuickPickWithShortcuts } from "./command-executor";
5+
import { ButtonSetManager } from "./managers/button-set-manager";
6+
import { ConfigManager } from "./managers/config-manager";
57
import { createQuickPickItems } from "./utils/ui-items";
68

79
export const createShowAllCommandsCommand = (
810
configReader: ConfigReader,
911
terminalExecutor: TerminalExecutor,
10-
quickPickCreator: QuickPickCreator
12+
quickPickCreator: QuickPickCreator,
13+
configManager: ConfigManager,
14+
buttonSetManager: ButtonSetManager
1115
) => {
1216
return () => {
13-
const buttons = configReader.getButtons();
17+
const activeSetButtons = buttonSetManager.getButtonsForActiveSet();
18+
const buttons = activeSetButtons ?? configManager.getButtonsWithFallback(configReader).buttons;
1419

1520
if (buttons.length === 0) {
1621
vscode.window.showInformationMessage(MESSAGES.ERROR.noCommands);

0 commit comments

Comments
 (0)