Incorrect naming convention warning with async

For methods that return a Task or Task<T>, please do not flag an invalid naming convention if the method name ends in Async. That's actually correct as someone could be implementing a method manually, or it could be a method in an interface that returns a Task or Task<T> where the implementation uses async/await.

Thanks,

5 comments
Comment actions Permalink

Any update on this?

Thanks

0
Comment actions Permalink

Hello Oren
     ReSharper should consider method names ending with 'Async' as correct. If you're seeing other behavior, could you please attach a screenshot demonstrating the warning? Thank you!

Andrey Serebryansky

Senior Support Engineer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"

0
Comment actions Permalink

I've attached a couple of screen shots from build 14. If I add "async" to the implementation, then the warning goes way, but the reality is that the 'async' keyword isn't what defines the pattern but the return type is. I'm free to create my own method that returns a Task that doesn't use await and the naming convention should be Async.

The Async naming convention rule is a good one -- but it should look for the return type of Task or Task<T> not the 'async' keyword.

Thanks



Attachment(s):
Async warning 2.png
Async warning.png
0
Comment actions Permalink

Nearly 4 years later, is there any chance https://youtrack.jetbrains.com/issue/RSRP-287169 is going to be fixed soon?

0

Please sign in to leave a comment.