JetBrains Rider 2021.2 Help

Inspection Settings

In this page of JetBrains Rider settings, you can specify your preferences for code inspection.

Enable code analysis

Select this checkbox to enable design-time code inspection.

Regardless of this checkbox, you can always run code inspection in specific scope.

Analysis

Read settings from editorconfig, project settings and rule sets

If you use EditorConfig to maintain code styles for your project, you can also configure code inspections from .editorconfig files.

If this checkbox is enabled, you can configure code inspection severity levels and C# naming styles right from .editorconfig files.

This checkbox also enables reading code inspection severity settings from Roslyn Analysers Rule Sets. For more information, see Rule Sets format

Enable solution-wide analysis

Enables Solution-wide analysis (including solution-wide code inspections), which is disabled by default.

Note that in large solutions, solution-wide analysis may result in some performance degradation. However, there are several ways to improve the performance of solution-wide analysis.

Enable computationally expensive inspections

Turns on the data-flow analysis and brings additional inspections, for example, to calculate nullability.

Monitor warnings

Enables warnings in Solution-wide analysis.

When warnings are enabled in solution-wide analysis, it works as follows: as long as there are errors in the solution, only errors will be displayed; unresolved warnings will only appear when the last error is fixed. When warnings are disabled, the status bar indicator will turn green as soon as the last error is fixed.

When this option is enabled, you can click Themed icon warning screen gray on the toolbar of the Errors/Warnings in Solution window to show or hide warnings in the window and in the status bar indicator without restarting the analysis.

Show unused non-private type members when solution-wide analysis is off

When this option is enabled, JetBrains Rider will detect all unused non-private members even if Solution-wide analysis is disabled. This option does not have any significant performance impact on small- and medium-sized solutions.

However, you may want to disable it if you experience performance problems in a large solution or when working with very large source files.

Show the 'Import namespace' action using popup

If this option is selected, a popup that suggests importing namespaces in C# and VB.NET shows up if one or more non-imported types are detected in the file:

Namespace import quick-fix

If the checkbox is not selected, the corresponding action will be available in the action list when you press Alt+Enter.

Value analysis mode

Using the value analysis, JetBrains Rider finds out which entities can hold null value and highlights possible errors with null dereference. You can choose one of the following modes.

  • Optimistic: when explicitly marked with [CanBeNull] attribute, or checked for null — JetBrains Rider assumes that only entities explicitly marked with CanBeNull or ItemCanBeNull attribute or explicitly checked for being null, can be null.

  • Pessimistic: when entity doesn't have explicit [NotNull] attribute — JetBrains Rider assumes that all nullable entities without an explicit NotNull or ItemNotNull attributes can be null.

Highlighting

Color identifiers

This option lets you enable or disable syntax highlighting scheme.

If it is selected, language identifiers are highlighted with colors as defined in settings pages under the Editor | Color Scheme page of JetBrains Rider settings Ctrl+Alt+S. in Visual Studio options: Tools | Options | Environment | Fonts and Colors.

Note that by disabling this option you also disable symbol information tooltips that appear on mouse over.

Highlight color usages

Enables highlighting of color definitions in code. For more information, see Color assistance.

Highlight special characters in string literals

Enables highlighting of correct and incorrect escape sequences in non-verbatim strings. For example:

Highlighting of escape sequence in strings

For more information, see Regular expressions assistance.

Highlight context exits

This option, which is enabled by default, tells JetBrains Rider to highlight all places where the control flow can exit the current context. For example, for a method, it will highlight the return type of the method, all return, throw keywords, and so on when you set the caret to one of these identifiers

JetBrains Rider highlights context exits

For a loop, it will additionally highlight the loop keyword as well as all the break statements inside this loop.

Note that if a method is not entirely visible in the editor, you can invoke the Navigate To Function Exits command on the method name to trigger another kind of highlighting, which will not disappear when your caret leaves the method name.

Highlight related async/await keywords

Elements to skip

JetBrains Rider allows you to configure the list of files, file masks, and folders that should be excluded from code inspection. The excluded items are ignored by both design-time code inspection and code inspection in specific scope, but they are still indexed by JetBrains Rider, so that you can navigate to or refactor symbols excluded from code inspection.

Last modified: 08 March 2021