ReSharper 2024.1 Help

Grammar and spelling analysis

One important task of code inspection is the analysis of grammar and spelling in natural languages. ReSharper will look for spelling and grammar errors in identifiers, comments, and string literals. When it detects a potential error or a typo, it will let you know in the same way as for other code issues — in design time or when you run code inspection in specific scope.

In this section:

Configure spelling and grammar inspections

By default, spelling and grammar inspections are enabled for almost all contexts. You can enable/disable individual inspections and change their severity levels by searching for typo and grammar on the Code Inspection | Inspection Severity page of ReSharper options Alt+R, O.

If you have methods that are supposed to receive raw text with spelling and grammar errors, you can mark the corresponding parameters with the [IgnoreSpellingAndGrammarErrors] from JetBrains.Annotations. This will disable warnings for callers of the method.

public class Sample { void Out([IgnoreSpellingAndGrammarErrors] string str) { Console.WriteLine(str); } void Test() { // no warnings Out("wiht erorrs speld texxt"); } }

You can disable grammar and spelling analysis by clearing the Grammar and Spelling checkbox on the Environment | Products & Features page of ReSharper options Alt+R, O.

This feature is supported in the following languages and technologies:

Language: C#

Language: VB.NET

Language: C++

Language: HTML

Language: ASP.NET

Language: Razor

Language: JavaScript

Language: TypeScript

Language: CSS

Language: XML

Language: XAML

Language: Resx

Language: Build Scripts

Language: Protobuf

Language: JSON

Feature is available in C#

Feature is available in Visual Basic

Feature is available in C++

Feature is available in HTML

Feature is available in ASP.NET

Feature is available in Razor

Feature is available in JavaScript

Feature is available in TypeScript

Feature is not available in CSS

Feature is available in XML

Feature is available in XAML

Feature is available in Resource files

Feature is not available in build script files

Feature is not available in Protobuf

Feature is available in JSON

The instructions and examples given here address the use of the feature in C#. For more information about other languages, refer to corresponding topics in the ReSharper by language section.

Last modified: 11 February 2024