So I have a peice of code that via static analysis cannot determine the enumeration of this will only occur multiple times on an array. Since it doesn't understand it can only be an array, R# correctly suggests "warning this could be multiple enumeration". Seeing as I fully intend this, i use the comment to disable this once, resulting in:
// ReSharper disable once PossibleMultipleEnumeration
And this just really sucks. This would be substantially more useful if the comment generated was more like
// Multiple Enumeration of this contains no side effects. R#
// R# Multiple Enumeration of this contains no side effects.
with this being a keyword to signfy "once". There is no reason the syntax "disable" needs to be included. Your comment doesn't add value to my code. However if the comment was more along the lines I raised, it would provide semantic value AND value to resharper.
Given the range one:
// ReSharper disable PossibleMultipleEnumeration
// ReSharper restore PossibleMultipleEnumeration
This could be amended to such:
// Multiple Enumerations contains no side effects. R#
// End Multiple Enumerations contains no side effects. R#