I've experienced some awkward intermittent bugs where async methods were returning void rather than Task and hence were not being awaited. to avoid such problems in the future I'm trying to create a custom resharper pattern to highlight such methods as warnings.
I've created a pattern like:
async void $methodname$($arguments$)
{
$statements$
}
(where arguments and statements allow unlimited number of each and method matches is an identifier containing 1 or more legal identifier characters)
Oddly this highlights all void methods rather than just async void methods. Can anyone see my mistake? As it seems like a common pattern to attempt to match, and google doesn't report it, I doubt if it's an outstanding issue in Reshaper 8.2.1.
P.S. I know my pattern won't match generic methods - if I can get it working for non-generic ones I'll fix that up later)
UPDATE
As highlighted in the comments I realise there are a number of false positives and false negatives that this rule would not handle. My concern here is how to get async matching to work in resharper - once that works I can look to make the rule more precise.