Show command descriptions as tooltips in Command Palette#284609
Show command descriptions as tooltips in Command Palette#284609TylerLeonhardt merged 13 commits intomicrosoft:mainfrom
Conversation
|
There is a lot of code style changes in this PR, some of which go against our style guides. Can you please revert all the styling changes and only include the actual functional change |
|
@TylerLeonhardt Thanks for the feedback! I've reverted all formatting and code-style changes and kept only the Please let me know if this looks better now. |
TylerLeonhardt
left a comment
There was a problem hiding this comment.
please make the change for only the commands quick access
|
@TylerLeonhardt I've reverted the changes in the global QuickPick renderer and scoped the tooltip behavior Please let me know if this looks correct now. |
| 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 | ||
| }; | ||
| } | ||
| } |
There was a problem hiding this comment.
the commandPick has the commandDescription already.
There was a problem hiding this comment.
@TylerLeonhardt Thanks for the clarification!
You're absolutely right — commandPick already contains
commandDescription. I've removed the CommandsRegistry.getCommand
lookup and now directly use commandPick.commandDescription when
setting the tooltip.
This keeps the change minimal and aligns with the existing
Command Palette data flow.
Please let me know if this looks correct now.
| if (commandPick.type === 'separator') { | ||
| return commandPick; | ||
| } | ||
| if (!commandPick.tooltip && commandPick.commandDescription) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
@TylerLeonhardt Thanks for the guidance!
I've updated the implementation.
Please let me know if this looks good now.
|
Thanks for contributing! Nice work! |
|
Thankyou @TylerLeonhardt....Looking forward to do more such contributions to the organization. |
| 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'; |
There was a problem hiding this comment.
This is unused, please delete it
Head branch was pushed to by a user without write access
6771b82
|
My hope is that adding descriptions is more interesting now that this is available |

What this PR does
This PR surfaces existing command descriptions as native tooltips in the
Command Palette.
VS Code already stores command metadata (including descriptions) in
CommandsRegistry, but this information was not visible in the UI.This change exposes that existing data via a simple hover tooltip,
making it easier to explore and understand less familiar commands.
Why this is useful
Implementation details
CommandsRegistry.getCommandmetadata.descriptionwhen available (with localized string support)titleattribute)Notes
Local build was not run due to environment constraints. This change is
isolated to the Quick Input UI layer.
Fixes #260868
@TylerLeonhardt...Please look into this