mediatr-plugin icon indicating copy to clipboard operation
mediatr-plugin copied to clipboard

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

Open ArtemGold opened this issue 1 year ago • 6 comments

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?

ArtemGold avatar Aug 02 '23 12:08 ArtemGold

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?

kzryzstof avatar Aug 02 '23 12:08 kzryzstof

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?

ArtemGold avatar Aug 03 '23 14:08 ArtemGold

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

kzryzstof avatar Aug 03 '23 15:08 kzryzstof

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.

kzryzstof avatar Sep 27 '23 12:09 kzryzstof

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

ArtemGold avatar Nov 30 '23 13:11 ArtemGold

@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.

kzryzstof avatar Nov 30 '23 14:11 kzryzstof