Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/vs/platform/quickinput/browser/commandsQuickAccess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { IQuickAccessProviderRunOptions } from '../common/quickAccess.js';
import { IKeyMods, IQuickPickSeparator } from '../common/quickInput.js';
import { IStorageService, StorageScope, StorageTarget, WillSaveStateReason } from '../../storage/common/storage.js';
import { ITelemetryService } from '../../telemetry/common/telemetry.js';
import { CommandsRegistry } from '../../commands/common/commands.js';
import { Categories } from '../../action/common/actionCommonCategories.js';

export interface ICommandQuickPick extends IPickerQuickAccessItem {
Expand Down Expand Up @@ -274,7 +275,18 @@ export abstract class AbstractCommandsQuickAccessProvider extends PickerQuickAcc
if (commandPick.type === 'separator') {
return commandPick;
}

if (!commandPick.tooltip) {
const command = CommandsRegistry.getCommand(commandPick.commandId);
if (command?.metadata?.description) {
commandPick = {
...commandPick,
tooltip:
typeof command.metadata.description === 'string'
? command.metadata.description
: command.metadata.description.value
};
}
}
Comment on lines +278 to +289
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the commandPick has the commandDescription already.

const keybinding = this.keybindingService.lookupKeybinding(commandPick.commandId);
const ariaLabel = keybinding ?
localize('commandPickAriaLabelWithKeybinding', "{0}, {1}", commandPick.label, keybinding.getAriaLabel()) :
Expand Down