Support diagnostics (declaration):
- Analyze if method has
Async
suffix - Analyze if method has
CancellationToken
parameter - Analyze if method's
CancellationToken
has namecancellationToken
- Analyze if
CancellationToken
is last parameter in method
Contains CodeFixes (declaration):
- Rename method name without
Async
suffix - Add missing
CancellationToken cancellationToken
parameter - Rename
CancellationToken
parameter tocancellationToken
when name is not matched - Reorder method parameters and put
CancellationToken
as last parameter
Support diagnostics (invocation):
- Analyze if
invoked
method hasAsync
suffix - Analyze if
invoked
method hasCancellationToken
parameter- checks if
CancellationToken
parameter is present in scope where asynchronous method isinvoked
and add possibility to use it - add possibility to enhance declaration and use
CancellationToken.None
- checks if
Contains CodeFixes (invocation):
- Rename method name without
Async
suffix - Add missing
CancellationToken cancellationToken
parameter- Add cancellation token to declaration and invocation (
CancellationToken.None
) - Add cancellation token to declaration and invocation (reuse
cancellationToken
from method scope where is invoked)
- Add cancellation token to declaration and invocation (
Declaration:
async void
method declarationsTask
method declarationsasync Task
method declarationsTask<T>
method declarationsasync Task<T>
method declarations
Invocation:
async void
method invocationsTask
method invocationsasync Task
method invocationsTask<T>
method invocationsasync Task<T>
method invocations
Example Declaration:
public Task MyMethod() // => Declaration analyzers analyzers will rise diagnostics
{
}
Example Invocation:
public Task MyMethod()
{
return AnotherAsyncMethod(); // => invocation analyzers analyzers will rise diagnostics
}
- refactorings to remove code duplicity
- improve
Texts
- add another
analyzers
andcodefixes
- reorder
Func<T,....>
generics whenCancellationToken
is detected - reorder
Action<T,....>
generics whenCancellationToken
is detected - detect and convert
async void
methods toTask
methods
- reorder
- improve automatic
simplification
- add test code :D