Search code examples
visual-studiorazorvisual-studio-2013resharperresharper-2016

What do the green underscores in the Script section of my cshtml indicate, and how can I ungreenify them?


In Visual Studio (2013, if it's significant) I see this in the "Scripts" section of a .cshtml file:

enter image description here

The green undersscores may actually be being rendered by Resharper (version 2016.1, if it's significant).

I suspect this is some sort of warning, but how can I see what the warning is, and how to resolve whatever is causing the warning? Hovering does nothing; 2-clicking does invoke a "Format Selection" icon (doubtless from Resharper), but selecting it does nothing.


Solution

  • This is a ReSharper hint - it's saying that it can make a change here that is likely to improve your code, but isn't necessarily important (if it were more important it would be displayed as a full squiggly underline, green for suggestion, blue for warning, red for error).

    You can find out what ReSharper wants to do by hovering over the green dots. If you like the hint, put the text cursor inside the green dots, hit Alt+Enter and select the option that will update the code. If you don't like the hint at all, and never want to see it again, you can also do that from the Alt+Enter menu - select inspection options, and change the severity of the inspection from "Hint" to "Do not show".