You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all, really like what you are trying to do here. Quick question. I was able to get CommandConfiguration object working with KeyBinding/Shortcut:
public override CommandConfiguration CommandConfiguration => new("MyExtension.Command1.DisplayName")
{
// Use this object initializer to set optional parameters for the command. The required parameter,
// displayName, is set above. DisplayName is localized and references an entry in .vsextension\string-resources.json.
//Placements = [CommandPlacement.KnownPlacements.ExtensionsMenu],
Icon = new (ImageMoniker.KnownValues.FieldInternal, IconSettings.IconAndText),
Shortcuts = new[]
{
new CommandShortcutConfiguration(ModifierKey.LeftAlt, Key.C, ModifierKey.LeftAlt, Key.VK_OEM_COMMA)
}
};
My question is there doesn't seem to be a way to show the Keybindings/Shortcut in the menu, either in the MenuConfiguration that has the command or the ComandConfiguration of the command.
Am I missing something, or is this just not yet implemented?
The text was updated successfully, but these errors were encountered:
Ok, I can now report a bug. As you can see in the above comment, the Placements property is commented out. That is because I set the Command as a sub-menu item in ExetnsionsEntrypoint.cs:
[VisualStudioContribution]
public static MenuConfiguration CommentScribeExtensionMenu => new MenuConfiguration("MyCommands")
{
Placements = new[] { CommandPlacement.KnownPlacements.ExtensionsMenu },
Children = new MenuChild[]
{
MenuChild.Command<Command1>(),
MenuChild.Command<Command2>()
},
};
In this configuration, no Shortcuts/Keybindings are shown.
However, if I remove the Commands from this config, and use the Placements property on the command itself, the individual menu item shows up with Shortcuts/Keybindings.
Thuse the bug is this:
Commands that have direct placement show the shortcuts/keybindings.
Commands are are Children in other MenuConfiguration items do not show shortcuts/keybindings.
Expected behavior:
Commands in menu items, no matter how placed, will always show shortcuts/keybindings.
Hi all, really like what you are trying to do here. Quick question. I was able to get CommandConfiguration object working with KeyBinding/Shortcut:
My question is there doesn't seem to be a way to show the Keybindings/Shortcut in the menu, either in the MenuConfiguration that has the command or the ComandConfiguration of the command.
Am I missing something, or is this just not yet implemented?
The text was updated successfully, but these errors were encountered: