Skip to content
Merged
Changes from 9 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
7 changes: 7 additions & 0 deletions 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';
Copy link
Member

Choose a reason for hiding this comment

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

This is unused, please delete it

import { Categories } from '../../action/common/actionCommonCategories.js';

export interface ICommandQuickPick extends IPickerQuickAccessItem {
Expand Down Expand Up @@ -274,6 +275,12 @@ export abstract class AbstractCommandsQuickAccessProvider extends PickerQuickAcc
if (commandPick.type === 'separator') {
return commandPick;
}
if (!commandPick.tooltip && commandPick.commandDescription) {
Copy link
Member

Choose a reason for hiding this comment

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

I'd rather you compute the tooltip first, and then add it to the spread that's happening further down.

So

const tooltip = commandPick.tooltip || commandPick.commandDescription.value;

Similar to how aria label is handled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TylerLeonhardt Thanks for the guidance!
I've updated the implementation.
Please let me know if this looks good now.

commandPick = {
...commandPick,
tooltip: commandPick.commandDescription.value
};
}

const keybinding = this.keybindingService.lookupKeybinding(commandPick.commandId);
const ariaLabel = keybinding ?
Expand Down