Spell checker update 2.2: full support for VS 2008 SP1, simpler setup and a few bug fixes
This version is obsolete. Please refer to Visual Studio Gallery http://visualstudiogallery.msdn.microsoft.com/en-us/2f3d691d-8838-4d84-ad64-44a02db37e30 for the most up-to-date information and download. For VS 2010 version look here: http://visualstudiogallery.msdn.microsoft.com/en-us/0db4814c-255e-4cc6-a2c2-a428de7f8949
What’s new in version 2.2:
- Spell checker now fully supports VS 2008 SP1
- Content of <code>, <abbr> and <address> elements is ignored
- Setup no longer requires COM registration, it uses VS AddIn registration in XML file
- List of words to ignore (SpellChecker.ignore file) was moved from AppData to AddIns folder
- Fixed bugs:
- Add To Dictionary may corrupt Word custom dictionary file dictionary file was not in Unicode
- Windows update to MSXML may cause “Ignore” and “Add To Dictionary” command to disappear
- After word was added to dictionary it may continue to be flagged as an error until VS is restarted
Spell checker supports text verification in:
- HTML style comments <– HTML –>
- ASP.NET server side comments: <%– ASP.NET –%>
- JScript, C# and C++ comments: // C++ style comments
- CSS and C style comments: /* C style comments */
- VB and VBScript style comments: ‘This is VB comment
Spell checking is supported in style and script blocks as well as in JS, CS, VB, CSS, CPP and H files
Microsoft Visual Studio 2008 SP1, any edition except Express.
Microsoft Word 2003 or 2007
- Close Visual Studio
- Uninstall previous version
- Download and run VSSpellChecker.msi
- Run Visual Studio
- Open a Web site or standalone HTML file.
- You should see Spell Checker entry in the Tools menu.
The add-in is now installed in your user folder under DocumentsVisual Studio 2008Add-Ins. More details on VS AddIn XML registration can be found here. Spell checking engine remains native C++ dll, but I added a managed wrapper which can be registered using simple XML file and hence COM registration is no longer needed. This should solve issues with setup under Vista and UAC.
- Close Visual Studio
- Open Control Panel
- Go to Add/Remove Programs
- Locate Spell Checker Add-in for Visual Studio 2008 and click Remove
How to use the Spell Checker
Important note: Add-in does not work with Visual Web Developer Express as Express editions are not extensible.
Open a Web Form, HTML, ASP, JS, VBS, CS, VB, CPP or CSS file and click Tools | Spell Checker. Spell check may take 10-15 seconds on decently sized files. There is no immediate progress indication, but you can see that squiggles appear one by one under misspelled words. Double click on the misspelled word brings list of suggestions. <Cancel> closes the suggestion list. Spell checker messages also show up in the Error List as informational messages. They are not entered as errors or warnings so they don’t break builds.
Switching off spelling errors:
Ignore command adds word to SpellChecker.ignore file. The file it located in DocumentsVisual Studio 2008AddInsSpell Checker. It is an Unicode text file.
Add to Dictionary command
Add to Dictionary command modifies Microsoft Office custom dictionary file. Typically it is an Unicode text file that is stored in the roaming profile in the MicrosoftUProof folder
You can edit list of words in the Office custom dictionary using Microsoft Word facilities:
Since using custom dictionary and ignore list introduces certain perfomance hit (which depends on the dictionary size), you can turn it off in rules.xml file located in the Spell Checker installation folder and change useOfficeCustomDictionary and/or useIgnoreList to 0.
Multilanguage spell checking
Spell checker is able to detects lang attribute specified on elements, extract ISO language and use it to specify appropriate dictionary for the Office spell checking engine.
In order to be able to spell check pages in multiple languages you may need to install Microsoft Office 2003 Proofing Tools or an appropriate Office 2007 Language Pack. If you never used particular language dictionary in Word, you have to try using it at least once before it becomes available in the Spell Checker add-in. Many dictionaries are installed on demand and if particular language was never activated in Word, the dictionary may be missing. Open Word, type something in the desired language and run Word spell checker at least once to make sure it works and dictionary is installed:
If you want to spell check multiple pages at one, look at this post: Running Spell checker on all files in the solution
Spell checker only works in Source view.
- Current version does not merge words split by tags, such as <b>S</b>ymbol. I am planning to add this functionality in a future version.
- Right click on the misspelled word does not bring suggestions, double-click does.
You can customize spell checker behavior by editing rules.xml file located in Program FilesHTML Spell Checker Add-In. You can exclude certain elements and add more rules for attribute checking if you want spell checker to verify spelling in custom control attributes. All element and attribute names much be in lowercase. You don’t have to close document or Visual Studio after editing the file, the file is loaded every time spell checking is performed.
<?xml version="1.0" encoding="utf-8"?>
<!-- Exclude content of script and style elements from spell check -->
<exclude name="script" />
<exclude name="style" />
<!-- Check 'value' attribute on all elements without a namespace -->
<attribute name="value" />
<!-- Rules in ASP namespace -->
<!-- Check all attributes ending in 'text' as well as tooltip attribute in all ASP.NET elements -->
<attribute name="*text" />
<attribute name="tooltip" />
<!-- Special rule for asp:Calendar -->
<attribute name="caption" />
<!-- Add more rules for ASP.NET elements here if needed -->
<!-- Add rules for custom controls here if needed -->