Grammar analysis
Grammar rules
ReSharper checks grammar against a set of rules defined for a language. For example, in English, there are rules on how to properly use articles, commas, and past tense forms, stylistic hints for creative and plain writing, common typos and words that are commonly confused, proper collocations, and many more.
Most of these rules are enabled by default and detect definite mistakes. However, some of them are suggestions that you may not agree with or not care about. In this case, you can disable a specific rule from the Alt+Enter menu or in the settings.
Configure the set of rules
Select Alt+R O, then choose on the left.
from the main menu or pressOn the Rules tab, expand the language node and select the rules against which you want to check your text.
Use the search field to filter the list of rules with a keyword, such as article
or comma
.
Exceptions
Exceptions are words and phrases that you want to be always considered correct. If some rule triggers a mistake in a phrase that you do not want to highlight, you do not need to disable this rule, because then it will not be triggered in other places where the rule is valid. In this case, you can add the phrase as an exception using the Alt+Enter menu.
Review all added exceptions
Select Alt+R O, then choose on the left.
from the main menu or pressOn the Exceptions tab, you can see the list of words and phrases added as exceptions. Remove an exception by selecting it and clicking Remove.
Configure grammar inspections
By default, grammar inspections are enabled for almost all contexts. You can enable/disable individual inspections and change their severity levels by searching for grammar
on the page of ReSharper options .
If you have methods that are supposed to receive raw text with grammar errors, you can mark the corresponding parameters with the [IgnoreSpellingAndGrammarErrors] from JetBrains.Annotations. This will disable warnings for callers of the method.
You can disable grammar and spelling analysis by clearing the Grammar and Spelling checkbox on the page of ReSharper options .