microsoft / microsoft/VSExtensibility
Can't customize shortcuts of commands configured without an explicit Placements using VS's keyboard settings
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 440
- Forks
- 63
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 1
Description
If you configure a command like this:
public override CommandConfiguration CommandConfiguration => new("%MyExtension.MyCommand1.DisplayName%")
{
Icon = new(ImageMoniker.KnownValues.FindInFile, IconSettings.IconAndText),
Placements =
[
// Solution context menu
CommandPlacement.VsctParent(new Guid("{d309f791-903f-11d0-9efc-00a0c911004f}"), id: 537, priority: 0x0300)
],
};
It will show up in the keyboard settings, allowing you to define and change its shortcut.
But if the same command is part of a sub menu, like so:
[VisualStudioContribution]
public static MenuConfiguration Menu => new("%MyExtension.ExtensionsCommandMenu.DisplayName%")
{
Placements =
[
CommandPlacement.KnownPlacements.ExtensionsMenu
],
Children =
[
MenuChild.Command<MyCommand1>()
],
};
The command won't show up.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the two configurations using CommandConfiguration, MenuConfiguration, and MenuChild.Command(), then trace how commands in submenus are registered for Visual Studio's keyboard settings. Done means a command included in a submenu without an explicit Placements entry appears in keyboard settings and its shortcut can be customized.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100