ReSharper executes its code analysis by applying inspections. The list of inspections includes:
- Compiler errors and warnings.
- ReSharper's own inspections.
To display the list of ReSharper's own inspections, choose ReSharper | Options | Code Inspection | Inspection Severity.
Every inspection has one of the following four severity levels (see
- 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:
Finding Out What is Wrong with Your Code ). - Displays an unresolved symbol in red:
- Warnings. ReSharper provides you with warnings that don't 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 are highlighted with a solid green underline. Move the mouse pointer over a highlighted item to
view the corresponding hint in a tooltip:
Putting the caret at a highlighted item allows you to display the hint in the status bar.
