Skip to content

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

@ycholette

Description

@ycholette

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions