Integrated spell checking with ReSpeller in ReSharper and Rider
The latest builds of ReSharper 2018.2 EAP and Rider 2018.2 EAP come with the ReSpeller extension, providing spell-checking functionality out of the box. Just like with code analysis, ReSpeller scans for spelling mistakes and typos in identifiers, comments, string literals and more, and provides quick-fixes to resolve the problem. Let’s have a look!
Spell-checking in the editor
ReSpeller will look for spelling mistakes in identifiers, comments, and string literals. When it detects a potential spelling mistake or a typo, it will let us know in the same way ReSharper and Rider display other code suggestions:
We can then invoke the Alt+Enter menu where ReSpeller gives us several options to fix our mistake: we can either fix our typo or add this word to ReSpeller’s dictionary.
When selecting Replace with…, ReSpeller provides us with several suggestions. By default, the best match will be selected (“parameters” in this example), but other versions are provided as well. Perhaps we meant to use the singular “parameter”? And yes, “par meters” exist – they measure Photosynthetically Active Radiation in case you wanted to know.
What’s nice about ReSpeller is that it automatically invokes the Rename refactoring when fixing a typo in an identifier. This ensures that our spelling correction preserves consistency across our code base. Note that in the Rename dialog, we can press Ctrl+Space to invoke code completion – or in this case, word completion.
Now, where do these suggestions come from…
By default, Rider and ReSharper come with a built-in dictionary for English (United States). It uses a dictionary based on Hunspell, which means we can install other languages as well. Being a native Dutch speaker (well, Flemish), I’ve downloaded the corresponding
.dic files and imported it in ReSharper’s settings:
Et voila! (yes, you can add French, too, and many more languages) We now have spell checking for Dutch:
Remember that the quick-fix on a spelling mistake also showed the option Add to user dictionary? It allows us to add a custom word to ReSpeller’s dictionary. And just like with settings layers, we can choose to add that word to a dictionary on our own machine or share it with the entire team.
Configuring ReSpeller code analysis
By default, ReSpeller is enabled in many of ReSharper’s supported languages. We can enable/disable individual inspections and change severity by searching for “typo” in the settings (under Code Inspection | Inspection Severity).
There are many cases where spell checking is important or even critical. ReSharper and Rider now help detect and resolve them.
Subscribe to Blog updates
Thanks, we've got you!
Another Look into the Future with Rider’s Predictive Debugger
In the 2023.2 release cycle, we’ve introduced the Predictive Debugger in ReSharper, which gives you predictions about code paths and variables beyond the current execution pointer. We’ve written extensively about its advantages compared to alternative debugging strategies like thorough thinking, log…
Visualize Entity Framework Relationships and Additional Query Analysis in ReSharper 2023.3
A lot of teams are using Entity Framework or EF Core to work with their database. As an Object-Relational Mapper (ORM), it bridges objects in code to a relational database model, so that as a developer you don’t have to worry too much about the actual database. We all know: that’s not entirely tr…
Automatically Analyze ASP.NET Core Performance With Dynamic Program Analysis
Slow web pages may make your users or customers abandon your web application, even before they’ve had a proper look at it. You’ve likely also been frustrated working with a web application that is slow to load. The good news is that the latest versions of ReSharper and JetBrains Rider’s Dynamic P…
OSS Power-Ups: MassTransit – Webinar Recording
The recording of our webinar, OSS Power-Ups: MassTransit, with Chris Patterson, is available. This was the thirteenth episode of our OSS Power-Ups series, where we put a spotlight on open-source .NET projects. Subscribe to our community newsletter to receive notifications about future webinars.…