By default, ReSharper starts analyzing a code file as soon as you open it in the editor, all the way you edit it, until it is closed. All detected code issues are highlighted in the editor according to the severity levels. The map of the issues is also displayed on the marker bar in the right part of the editor window, where you can see instantly the status of the file and click the marks to navigate to specific code issues.
By default, design-time code inspection is enabled in all supported languages. However, you can disable it everywhere or turn it off for specific files For more information on configuring code inspection, see Configuring Code Inspection Settings.
- In the ReSharper Options | Code Inspection | Settings, use the Enable code analysis check box to toggle the design-time code inspection. While you are on this page, you can check out available code inspection configuration options.
- If necessary, you can select the Analyze errors in whole solution check box to enable the Solution-Wide Analysis.
- Click Save to apply the modifications and let ReSharper choose the settings layer, or choose a particular settings layer in the Save To drop-down list. To learn more about saving ReSharper settings, see JetBrains .NET Tools Blog: Save or Save To in ReSharper Options.
The easiest way to deal with code issues highlighted in the editor, is to set the caret on the highlighted code item and press Alt+Enter or click on the action indicator that appears to the left of the code issue. The action list will pop up where ReSharper suggests one or more quick-fixes for most issues.
Besides suggested fixes, for each code issue under your caret ReSharper shows the Options for inspection sub-menu in the actions list, with the following items:
- Disable once with comment
- Disable and restore with comment
- Configure inspection severity
- Find all issues of this type
- For the most controversial issues, there is the Why is ReSharper suggesting this? item that opens a Code Inspection Wiki page with detailed description of the corresponding inspection.
You can disable the Options for inspection sub-menu. To do so, uncheck the Show code inspection options in action list check-box in the ReSharper | Options | Code Inspection | Settings.
- Code Analysis
- Code Inspection
- Inspection Severity Levels and Highlighting
- Marker Bar and Status Indicator
- Solution-Wide Analysis
- Quick-Fixes for Code Issues
- Solution-Wide Code Inspections
- Structural Search and Replace
- Inspecting Code in Specific Scope
- ReSharper Options | Code Inspection | Settings
- ReSharper Options | Code Inspection | Inspection Severity