All ReSharper code inspections as well as structural search and replace patterns have one of the following four severity levels. According to the severity level, the code issue is highlighted in a particular way and the corresponding mark is added to the marker bar.
If you do not need a particular inspection, press Alt+EnterAlt+Enter while you at the corresponding code and select Options for inspection. Then you can choose to disable it with comment or change its severity level to Do not show.
Highlightings help you quickly detect the severity of the code issue:
Errors. Errors have the highest priority of all - they prevent your code
from compiling. When ReSharper detects an error, it highlights it in one of two alternative ways:
Displays an unresolved symbol in red:
Highlights a construct or part of it with a red curly underline:
In Visual Studio project settings, you can choose to treat warnings as errors. ReSharper is aware of this option and highlights warnings accordingly: if this setting is on, then issues that correspond to compiler warnings will be highlighted as errors and the status indicator will be red
This setting is configurable at project properties: Project | [Project Name] Properties | Treat warnings as errors and can be applied to all warnings if All is selected or to the specified warnings only.
- Displays an unresolved symbol in red:
Warnings. ReSharper provides you with warnings that do not prevent
your code from compiling but may nevertheless represent serious coding inefficiencies.
For example, ReSharper informs you about redundant type casts or namespace import directives,
incorrect format strings, declared but never used local variables or private fields,
unused private methods, etc.
Constructs that have associated warnings are emphasized in one of the following ways:
With grayed text:
With a blue curly underline:
- With grayed text:
Suggestions. Code suggestions provide insights into code structure,
drawing your attention to things that aren't necessarily bad or wrong, but probably useful to know.
Suggestions are highlighted with a green curly underline:
For instance, you might be interested to know that "parameter can be declared with base type", meaning that your method only uses members of the parameter's base type. This can be an indication of a different error, such as failure to take into account the specifics of the actual parameter type. Based on this knowledge, you may want to change the parameter's type - or not, if that is by design.
Hints. This is the lowest possible severity level. Unlike errors,
warnings and suggestions, hints are not taken into account when you navigate to next/previous highlights,
not shown in the Marker Bar and therefore do not influence the color of the Status Indicator.
A hint simply brings your attention to a particular code detail and recommends a way of improvement.
Code items that have associated hints have the initial two letters highlighted with a dashed green
underline. Note that when you set the caret over a highlighted item, the corresponding hint
message only appears in the status bar.
If necessary, you can change severity level of every code inspection except compiler errors. For more information, see Configuring ReSharper Inspections.