Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to reference Handle method with <see... and cref? #155

Open
jonmotos opened this issue Aug 16, 2024 · 1 comment
Open

Possible to reference Handle method with <see... and cref? #155

jonmotos opened this issue Aug 16, 2024 · 1 comment

Comments

@jonmotos
Copy link

One very exciting possibility of a source-generated mediator implementation is to ease the pain of tracking down what methods are called by the mediator, at design time. At runtime, step-through debugging makes this a breeze, but at design-time you must parse the generated code and follow a few steps in order to find the handler code, which is not something I want to force on my fellow developers.

Does the source generator know enough context to include an xml comment linking to the handler method? An example of this is the MVVM Community Toolkit source generators for RelayCommands, which generate the following

/// <summary>Gets an <see cref="global::CommunityToolkit.Mvvm.Input.IAsyncRelayCommand"/> instance wrapping <see cref="Initialize"/>.</summary>
public global::CommunityToolkit.Mvvm.Input.IAsyncRelayCommand InitializeCommand => initializeCommand ??= new global::CommunityToolkit.Mvvm.Input.AsyncRelayCommand(new global::System.Func<global::System.Threading.Tasks.Task>(Initialize));

This pattern has helped immensely to decouple our code, but it would be nice to have our cake and eat it to - the analyzers for unhandled messages and command are another huge usability bump!
@martinothamar
Copy link
Owner

Interesting, yeah sounds like a good idea 👍

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

No branches or pull requests

2 participants