You create a pattern for this about the way you would expect. Go to ReSharper > Find > Search with Pattern, and enter this pattern:
$enumerable$.First($args$)
Then in the placeholders list on the right, create two placeholders:
- Add Placeholder > Expression, and name it
enumerable
. Don't specify a type (I tried specifying the type asIEnumerable<out T>
and descendants, but for some reason that failed to find any usages; but if you don't specify a type, it works). - Add Placeholder > Argument, name it
args
, check the box for "Limit minimal number of arguments", and leave the number set to 1.
I tested this, and it found list.First(i => i%2 == 0)
but not list.First()
, so seems like exactly what you're asking for.