Boost your navigation superpowers in Rider and ReSharper with this plugin for Mediator-based applications. Quickly jump between IRequest
, INotification
, and their respective handlers—like teleportation for your CQRS architecture.
- Supports JetBrains Rider & ReSharper
- Navigate from
IRequest
/INotification
to their handlers for both MediatR and Mediator NuGet packages
graph TB
subgraph "IDE Integration Layer"
A1[Rider Action<br/>GoToHandlrAction.kt]
A2[ReSharper Provider<br/>MediatorRequestNavigateFromHereProvider.cs]
end
subgraph "Core Navigation Engine"
B1[HandlerSelector<br/>Service]
B2[Navigation<br/>Coordinator]
end
subgraph "Library Abstraction Layer"
C1[ILibrary<br/>Interface]
C2[MediatRLibrary<br/>Implementation]
C3[MediatorLibrary<br/>Implementation]
end
subgraph "External Libraries"
D1[MediatR<br/>NuGet Package]
D2[Mediator<br/>NuGet Package]
end
A1 --> B1
A2 --> B1
B1 --> B2
B2 --> C1
C1 --> C2
C1 --> C3
C2 -.-> D1
C3 -.-> D2
The plugin provides two main entry points for navigation:
- Rider Integration (
GoToHandlrAction.kt
): A Kotlin-based action that integrates with Rider's action system - ReSharper Integration (
MediatorRequestNavigateFromHereProvider.cs
): A C# provider that adds "Go to handler" to ReSharper's context navigation
- Detection: User right-clicks on an
IRequest
orINotification
interface - Context Analysis: Plugin identifies the selected element and validates it's a mediator request/notification
- Library Resolution: Determines whether the project uses MediatR or Mediator library
- Handler Discovery: Searches the solution for corresponding
IRequestHandler
orINotificationHandler
implementations - Navigation: Opens the handler class in the editor
The plugin uses a sophisticated abstraction layer to support both MediatR and Mediator libraries:
Common Interface (ILibrary
):
FindHandlers()
: Locates handler implementations for a given request/notificationIsSupported()
: Determines if the library can handle the current contextCreateHandlrFor()
: Generates new handler classes (code generation feature)
MediatR Support:
- Handles
MediatR.IBaseRequest
andMediatR.INotification
- Supports
IRequestHandler<T>
,IRequestHandler<T,TResponse>
, andINotificationHandler<T>
- Full integration with MediatR's interface contracts
Mediator Support:
- Handles
Mediator.IBaseRequest
andMediator.INotification
- Supports the same handler patterns as MediatR but for the Mediator library
- Provides identical functionality with different underlying type system
This abstraction allows the plugin to work seamlessly with both libraries without requiring users to configure which one they're using—the plugin automatically detects and adapts to the project's mediator implementation.
# Open the solution
MediatorPlugin.slnx
# Ensure NuGet feed is available
https://api.nuget.org/v3/index.json
# In PowerShell:
./buildPlugin.ps1
./runVisualStudio.ps1
Once the new Visual Studio instance opens, go to:
ReSharper > Extension Manager
The MediatR extension should appear as version 9999.0
.
💡 You may need to remove the Rider project if it causes the build to fail.
./gradlew :runIde
Pull requests and plugin ideas are always welcome!
If you're using this in your own workflow, we’d love to hear about it.
📦 JetBrains Marketplace: