Home

Awesome

WeCantSpell.Roslyn

WeCantSpell.Roslyn is a spell check analyzer for Roslyn languages, such as C# and Visual Basic. It uses WeCantSpell.Hunspell, a fully managed C# port of the Hunspell spell checker engine, to check and suggest words.

Features

Installation

You can install WeCantSpell.Roslyn as a NuGet package using the following command:

dotnet add package WeCantSpell.Roslyn

Configuration

To use WeCantSpell.Roslyn, you need to configure the analyzer options in your project. There are two ways to do this:

{
    "isRoot" : true,
    "languages" : [
        "en-US",
        "ru-RU"
    ]
}

The isRoot property indicates whether the file is located in the solution root or not. The languages property specifies the list of languages to use for spell checking.

You also need to set the severity of the analyzer diagnostics in your editorconfig file. For example:

root = true

[*.{cs,vb}]
# WeCantSpell properties
dotnet_diagnostic.SP3110.severity = warning
dotnet_diagnostic.SP3111.severity = suggestion
dotnet_diagnostic.SP3112.severity = suggestion
dotnet_diagnostic.SP3113.severity = suggestion

The analyzer will report spelling errors in your code according to the following error codes:

For more details, please refer to the source code of the project.