microsoft / microsoft/VSExtensibility

Can't customize shortcuts of commands configured without an explicit Placements using VS's keyboard settings

Open
#562 0 comments 1 reaction 0 assignees View on GitHub

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.

Image

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.