roslynator
roslynator copied to clipboard
Add analyzer for missing CancellationToken
trafficstars
When a method that has a CancellationToken parameter calls another method without passing the cancellation token, it's usually a mistake. For instance:
private async Task FooAsync(CancellationToken cancellationToken = default)
{
...
await BarAsync(); // Cancellation token should be passed to BarAsync, but is not
...
}
private async Task BarAsync(CancellationToken cancellationToken = default)
{
...
}
An analyzer and quick fix for this would be useful.
(ReSharper has an inspection for this)