Add new analyzer/fixer for async void [RelayCommand] methods#714
Merged
Sergio0694 merged 5 commits intomainfrom Jun 8, 2023
Merged
Add new analyzer/fixer for async void [RelayCommand] methods#714Sergio0694 merged 5 commits intomainfrom
Sergio0694 merged 5 commits intomainfrom
Conversation
64e3aea to
d843aab
Compare
Member
Author
|
cc. @Youssef1313 as usual in case you felt in the mood to double check some analyzers/fixers 😄 |
Sergio0694
commented
Jun 7, 2023
...m.SourceGenerators.Roslyn401.UnitTests/Test_AsyncVoidReturningRelayCommandMethodCodeFixer.cs
Show resolved
Hide resolved
Youssef1313
reviewed
Jun 8, 2023
src/CommunityToolkit.Mvvm.CodeFixers/AsyncVoidReturningRelayCommandMethodCodeFixer.cs
Outdated
Show resolved
Hide resolved
Youssef1313
reviewed
Jun 8, 2023
src/CommunityToolkit.Mvvm.CodeFixers/AsyncVoidReturningRelayCommandMethodCodeFixer.cs
Outdated
Show resolved
Hide resolved
Youssef1313
reviewed
Jun 8, 2023
src/CommunityToolkit.Mvvm.CodeFixers/AsyncVoidReturningRelayCommandMethodCodeFixer.cs
Outdated
Show resolved
Hide resolved
Youssef1313
reviewed
Jun 8, 2023
src/CommunityToolkit.Mvvm.CodeFixers/AsyncVoidReturningRelayCommandMethodCodeFixer.cs
Outdated
Show resolved
Hide resolved
d843aab to
ce23265
Compare
Youssef1313
reviewed
Jun 8, 2023
tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/Test_SourceGeneratorsDiagnostics.cs
Show resolved
Hide resolved
...m.SourceGenerators.Roslyn401.UnitTests/Test_AsyncVoidReturningRelayCommandMethodCodeFixer.cs
Show resolved
Hide resolved
Youssef1313
reviewed
Jun 8, 2023
| id: AsyncVoidReturningRelayCommandMethodId, | ||
| title: "Async void returning method annotated with RelayCommand", | ||
| messageFormat: "The method {0} annotated with [RelayCommand] is async void (make sure to return a Task type instead)", | ||
| category: typeof(RelayCommandGenerator).FullName, |
Contributor
There was a problem hiding this comment.
I see this is already existing for all other descriptors, but I never seen categories to be very long names (CommunityToolkit.Mvvm.SourceGenerators.RelayCommandGenerator)
Member
Author
There was a problem hiding this comment.
Mmh good point. We might want to address this in a separate PR for all descriptors 🤔
Contributor
There was a problem hiding this comment.
Just a note: this will be a breaking change if someone is currently changing severity via dotnet_analyzer_diagnostic.category-TheLongCategoryName.severity = ...
Member
Author
There was a problem hiding this comment.
Gotcha. I suppose we could do that in 9.0 then 🙂
This was referenced Nov 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a new analyzer and code fixer for
async voidreturning[RelayCommand]methods.PR Checklist