Skip to content

Register GoToHandlerAction as a keyboard-assignable VS/ReSharper command with Alt+H default#108

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-keyboard-shortcut-issue
Draft

Register GoToHandlerAction as a keyboard-assignable VS/ReSharper command with Alt+H default#108
Copilot wants to merge 3 commits intomainfrom
copilot/fix-keyboard-shortcut-issue

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 16, 2026

Alt+H was intercepted by VS's Help menu and GoToHandlerAction was invisible in Tools > Options > Environment > Keyboard because no VS/ReSharper command was ever registered — only a Rider plugin.xml shortcut existed, which has no effect in Visual Studio.

Changes

  • New GoToHandlerNavigationAction — implements IExecutableAction decorated with [Action]:
    [Action("GoToHandlerAction", "Go to Handler",
        ShortcutScope = ShortcutScope.TextEditor,
        DefaultShortcutText = "Alt+H")]
    public class GoToHandlerNavigationAction : IExecutableAction
    • Update(): enables only when the cursor is on a supported MediatR/Mediator request identifier
    • Execute(): delegates to HandlerSelector.NavigateToHandler() — same logic as the existing context-menu and navigate-from-here paths
  • .gitignore: added .nuget/ to exclude tooling binaries

@kzryzstof
Copy link
Copy Markdown
Collaborator

@copilot Have you found any issues related to the problem described?

Copilot AI and others added 2 commits April 16, 2026 14:51
Register GoToHandlerAction as a VS/ReSharper IExecutableAction with [Action] attribute,
giving it a default keyboard shortcut of Alt+H with ShortcutScope.TextEditor.

This makes the action discoverable in Tools > Options > Environment > Keyboard
and allows users to invoke "Go to Handler" via keyboard shortcut.

Agent-Logs-Url: https://github.com/Octelys/mediator-plugin/sessions/327fae8f-5cf0-4735-846a-684624dc9296

Co-authored-by: kzryzstof <38137839+kzryzstof@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix keyboard shortcut for GoToHandlerAction Register GoToHandlerAction as a keyboard-assignable VS/ReSharper command with Alt+H default Apr 16, 2026
Copilot AI requested a review from kzryzstof April 16, 2026 14:54
Copy link
Copy Markdown
Author

Copilot AI commented Apr 16, 2026

@copilot Have you found any issues related to the problem described?

Yes. The root cause was that the plugin had no registered VS/ReSharper command for "Go to Handler" at all.

The keyboard shortcut in plugin.xml (<keyboard-shortcut keymap="$default" first-keystroke="alt H" />) only applies to Rider/IntelliJ — it is completely ignored by Visual Studio. For VS/ReSharper, an action must be registered as a .NET class that:

  1. Implements IExecutableAction
  2. Is decorated with [Action(...)] (which registers it with the ReSharper action system and makes it visible in VS Tools > Options > Environment > Keyboard)

The plugin had GoToHandlerAction (a ContextActionBase) for the right-click lightbulb menu and MediatorRequestNavigateFromHereProvider (a INavigateFromHereProvider) for the Navigate-from-here menu, but nothing that VS could bind a keyboard shortcut to.

The fix adds GoToHandlerNavigationAction which is the missing piece — an IExecutableAction with [Action("GoToHandlerAction", "Go to Handler", ShortcutScope = ShortcutScope.TextEditor, DefaultShortcutText = "Alt+H")]. This makes the action appear in the VS keyboard settings dialog under the name GoToHandlerAction with Alt+H pre-configured as the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VS 2026 / R# 2026.1 - Keyboard-Shortcut not working

2 participants