kzryzstof / mediatr-plugin

[Jetbrains] Ever got frustrated to find out where was the handler of a MediatR's IRequest? Say no more. This plugin provides a context action to easily reach the handler of any MediatR request. Select your MediatR request, click on that action and boom you will be automatically transported to the appropriate handler.
17 stars 1 forks source link

Go to a specific handler if there are a couple of them #53

Open ArtemGold opened 1 year ago

ArtemGold commented 1 year ago

In my project, I have more than one handler for every command, when I use "Go to HandlR" or a shortcut for it, it goes to the last one in my solution tree, most frequently I need the first one, does that plugin have the ability to choose what actual handler I need?

kzryzstof commented 1 year ago

Interesting... Would it be possible to provide a short - minimal example of requests / handlers mimicking your use case so that I can try to reproduce it and -hopefully- find a solution?

ArtemGold commented 1 year ago

Ok, I'll try. I have 4 projects in a solution: Abstractions - where stored actual command. Application - where the business logic and handler for that command do some job. Have reference to Abstractions. API - where I have endpoints. The user calls the endpoint and the API creates a new command, that is handled by the Application. Have reference to Abstractions and Application. Client - where I have a handler for the same command. This project is a NuGet package and can be used somewhere else. Handler logic calls the API endpoint from above. Also, have a reference to Abstractions and register Client's handler in another application.

So in this architecture, I have 2 handlers for each command, one in the Application, and one in the Client, all in one solution. Is this enough to understand?

kzryzstof commented 1 year ago

Thank you for the information! I will try to reproduce this use case to confirm the behavior.

kzryzstof commented 11 months ago

I have been investigating this on and off. The part that I do not get is the interaction between the resharper backend (C#) and the IntelliJ frontend... I have not found a proper working sample yet.

ArtemGold commented 9 months ago

Sorry for the long response. Do you mean you don't know how to implement or reproduce?

kzryzstof commented 9 months ago

@ArtemGold I have been able to reproduce the issue. Ideally, in such situation, the plugin would open a dialog box with the different handlers to choose from. However, the UI part in a Rider / ReSharper plugin is far from being straight forward. I tried a couple times in the past few months to support a UI component in the plugin but all these attempts have been unsuccessful.