roslynator icon indicating copy to clipboard operation
roslynator copied to clipboard

Pass CancellationToken on

Open jnyrup opened this issue 6 years ago • 5 comments
trafficstars

Places where a CancellationToken is available but not passed on to functions that takes an optional CancellationToken.

Some were found by making optional CancellationTokens mandatory, others by regex'ing the source code.

jnyrup avatar Apr 06 '19 20:04 jnyrup

Sometimes you use named arguments (cancellationToken: cancellationToken, ) and sometimes you just pass the parameter (cancellationToken, ). I think it would be better to use the non-named version to have consistency here.

Danghor avatar Apr 10 '19 19:04 Danghor

I intentionally used named arguments whenever necessary to avoid specifying additional optional arguments. Searching the existing codebase there it at least 22 places where there is a mix of named and non-named arguments.

jnyrup avatar Apr 10 '19 19:04 jnyrup

Oh, that makes sense. I didn't notice they were necessary to avoid specifying optional arguments.

Danghor avatar Apr 10 '19 20:04 Danghor

@JosefPihrt Can you comment on whether this PR is useful or should just be closed? If it is useful, is there anything I need to do, besides resolving the conflict, before it is ready?

jnyrup avatar Aug 06 '19 17:08 jnyrup

I will give you feedback shortly.

josefpihrt avatar Aug 08 '19 12:08 josefpihrt