Misspelled strings in your projects? Visual Studio Spell Checker (with source too)
- Posted: Aug 21, 2013 at 6:00 AM
- 17,401 Views
- 2 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Today's project by Eric Woodruff is one that I thought interesting and fun in a couple ways. Well maybe not "fun" fun, but fun in that, "oh, that's kind of cool and I want to see that code... and it's something that could make my day-to-day dev life easier" way...
Welcome to the Visual Studio Spell Checker ProjectThis project is a Visual Studio editor extension that checks the spelling of comments, strings, and plain text as you type or interactively with a tool window. It is based largely on the spell checker extension originally created by Noah Richards, Roman Golovin, and Michael Lehenbauer. This version has been extended as follows:
- It uses NHunSpell to perform the spell checking. As such, custom dictionaries can be added to spell check in different languages.
- Added the ability to spell check the inner text of XML elements as well as certain attribute values.
- Added support for replacing all occurrences of a misspelling via the smart tag context menu (hold down the Ctrl key when selecting a replacement word).
- Added an Ignore Once option to the smart tag context menu to ignore a specific instance of a misspelled word.
- Fixed up various issues to skip text that should not be spell checked and to break up text into words correctly when escape sequences are present in the text.
- Added an interactive spell checking tool window to find and fix spelling errors in the current file.
- Some new spell checking options have been added and all of the spell checking options have been exposed and can be configured. Configurable options include:
- The default language to use for spell checking.
- Enable or disable spell checking as you type.
- Ignore words with digits.
- Ignore words in all uppercase.
- Ignore words that look like filenames and e-mail addresses.
- Ignore words that look like XML elements in spell checked text.
- Treat underscores as separators.
- Specify a list of XML elements in which the content should be ignored when spell checking XML files.
- Specify a list of XML attributes for which the value should be spell checked when spell checking XML files.
You can also get it directly from the Visual Studio Gallery
Here's the code in action;
I dig that Eric released the source for this. There's a number of lessons we can learn by example from it...
Here's a snap of the Solution (which built for me the first time... make sure you read the readme.txt)
[I so wanted to "mispell" in the title, and in fact did in a number of drafts, but in the end just couldn't publish it that way... sigh... lol ]