Resharper no longer suggests things?
Answered
I have Dark theme in use. I've noticed that Resharper fails to suggest changing `.Count > 0` to `.Any()` and similar changes are no longer suggested.
I've looked into Inspection Severity, found this part and configured it to Error. Still does nothing to indicate any highlight.
Same issue persists in Visual Studio 2017 as well as Visual Studio 2019 projects.
What can I do to fix it?
Please sign in to leave a comment.
I just reset Reshaper options completely. Still doesn't highlight these improvement places the way it should.
Mikael Palmujoki, thank you for your question. Does the problem happen for a newly created solution or it's solution specific problem? What does a marker bar look like - https://i.imgur.com/lKFOibg.png? Could you please attach a screenshot of the VS window where the scrollbar would be visible? Thank you!
Hi Maria Pleskunina
I tried a newly created solution, and did the bad code there.
Here's a marker bar along with the `if (foo.Count > 0)` case and the marker bar.
So no suggestions for changing to `.Any()`.
Mikael Palmujoki, thanks for the reply. Sorry, I tried to reproduce the problem with .Count() instead of .Count.
In your case, it is preferable to use .Count instead of .Any(), since List knows its size and Count doesn't need to be calculated. At the same time, .Any() will create redundant entities (enumerator), creating an extra job for the Garbage Collector.
Well, alright, I kind of understand your logic there, why .Any() is perhaps not preferable.
But, still, why does it not highlight it in the editor, when I have in the settings that it should be highlighted as Error and suggested upon?

I'd expect Resharper to highlight according to the Inspection Severity rules. Feels broken still, despite your logic about this specific case. My issue is that Resharper does not really highlight much at all, feels like basic Visual Studio highlights. So whilst .Any() is a single case, I'm quite much more concerned about why the editor doesn't highlight according to Inspection Severity settings.
Does the highlighting appear if you change the code to the following (Count() instead of Count)?
Inspections's descriptions explicitly states that it works on "Count()" method and not "Count" property

Ohh true.
Thanks for bringing up the distinction here!
I guess we can close this issue.
I thought I already answered, but yes, Maria, adding the parenthesises did bring up the red underline. So highlighting works, I'm just being paranoid.