Spell checker update 2.2: full support for VS 2008 SP1, simpler setup and a few bug fixes

Spell checker update 2.2: full support for VS 2008 SP1, simpler setup and a few bug fixes

Rate This
  • Comments 27

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

Download: VSSpellChecker.msi:

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


Note: There is no v2.2 for VS 2005 or VS 2008 RTM. From now on updates will be provided for VS 2008 SP1 only. Version 2.1 will remain available for VS 2008 RTM and VS 2005 SP1.

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

Requirements:

Microsoft Visual Studio 2008 SP1, any edition except Express.
Microsoft Word 2003 or 2007

Installation

  • 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 Documents\Visual Studio 2008\Add-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.

Uninstall
  • 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

Ignore command adds word to SpellChecker.ignore file. The file it located in Documents\Visual Studio 2008\AddIns\Spell 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 Microsoft\UProof folder

Microsoft Office custom dictionary location

You can edit list of words in the Office custom dictionary using Microsoft Word facilities:

Microsoft Word menu

Microsoft Word proofing options Microsoft Word custom dictionary editor

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.

<options>
    <
useOfficeCustomDictionary>0</useOfficeCustomDictionary>
    <
useIgnoreList>0</useIgnoreList>
</
options>

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 

Limitations:


Spell checker only works in Source view.
  1. 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.
  2. Right click on the misspelled word does not bring suggestions, double-click does.

Customization

You can customize spell checker behavior by editing rules.xml file located in Program Files\HTML 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"?>
<rules>
<!-- 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 -->
<element name="*">
<attribute name="value" />
</element>

<!-- Rules in ASP namespace -->
<namespace name="asp">

<!-- Check all attributes ending in 'text' as well as tooltip attribute in all ASP.NET elements -->
<element name="*">
<attribute name="*text" />
<attribute name="tooltip" />
</element>

<!-- Special rule for asp:Calendar -->
<element name="calendar">
<attribute name="caption" />
</element>

<!-- Add more rules for ASP.NET elements here if needed -->
</namespace>

<!-- Add rules for custom controls here if needed -->

</rules>
Leave a Comment
  • Please add 1 and 4 and type the answer here:
  • Post
  • Spell checker update 2.2: full support for VS 2008 SP1, simpler setup and a few bug fixes Spell checker...

  • Any idea what's going wrong? After installation, I get the following error when loading Visual Studio:

    OS: Vista Ultimate SP1 64-bit (6.0.6001)

    VS: Professional 2008 SP1 (9.0.30729.1)

    .NET: 3.5 SP1

    "The Add-in 'Spell Checker' failed to load or caused an exception. Would you like to remove this Add-in? If you choose yes, the file it was loaded from, '...', will be renamed.

    Error Message: <Unknown Error>

    Error number: 8013150a"

  • 以前我们在Visual Studio如果要执行拼写检查都会把文本复制到Word里去做,费时费事。 现在Visual Studi ...

  • Note: this post is obsolete. Please use newer version: http://blogs.msdn.com/webdevtools/archive/2008/11/29/spell-checker-update-2-2-full-support-for-vs-2008-sp1-simpler-setup-and-a-few-bug-fixes.aspx

  • To run the spell checker on all files in the solution, you must update the VB macro in the linked post to use 'DTE.ExecuteCommand("VSSpellCheckerAddIn.Connect.VSSpellCheckerAddIn")' instead of the old HTML command name.

  • Nuova versione del correttore ortografico per Visual Studio 2008

  • Da qualche giorno è stata rilasciata la versione 2.2 dello Spell checker per Visual Studio 2008, destinata

  • The posted version is not working if you didn't install SP1 for VS 2008,once i installed SP1 for VS 2008 the spell checker v2.2 is working fine to me.

    Thanks.

  • Correct, this version requires SP1.

  • Given code to check the entire solution failed for me.. I ended up modifying to this :

    Imports System

    Imports EnvDTE

    Imports EnvDTE80

    Imports EnvDTE90

    Imports System.Diagnostics

    Public Module SpellCheck2

       Private _outputWindow As OutputWindowPane

       Public Sub SpellCheckSolution()

           _outputWindow = GetOutputWindowPane("Spell Checker")

           _outputWindow.Clear()

           _outputWindow.OutputString("Running spell check on files in the solution..." + vbCrLf)

           For Each project As Project In DTE.ActiveSolutionProjects

               ProcessProjectItemCollection(project.ProjectItems)

           Next

           _outputWindow.OutputString("Spell check complete." + vbCrLf)

       End Sub

       Private Sub ProcessProjectItemCollection(ByVal projItemsCollection As ProjectItems)

           Try

               For Each pi As ProjectItem In projItemsCollection

                   If (pi.Name.EndsWith("aspx") Or pi.Name.EndsWith("ascx") Or pi.Name.EndsWith("html") Or pi.Name.EndsWith("htm")) Then

                       Dim window As Window = pi.Open(Constants.vsViewKindTextView)

                       window.Visible = True

                       window.Activate()

                       _outputWindow.OutputString("Checking : " + pi.Name + vbCrLf)

                       DTE.ExecuteCommand("VSSpellCheckerAddIn.Connect.VSSpellCheckerAddIn")

                   Else

                       If pi.Kind = Constants.vsProjectItemKindPhysicalFolder Then

                           _outputWindow.OutputString("Container : " + pi.Name + vbCrLf)

                           ProcessProjectItemCollection(pi.ProjectItems)

                       Else

                           _outputWindow.OutputString("Not Checking :" + pi.Name + vbCrLf)

                   End If '' end folder check

                       End If ''end  file extension check

               Next ''Get next project Item

           Catch e As System.Exception

               _outputWindow.OutputString(e.Message + vbCrLf)

           End Try

       End Sub

       Private Function GetOutputWindowPane(ByVal Name As String) As OutputWindowPane

           Dim window As Window

           Dim outputWindow As OutputWindow

           Dim outputWindowPane As OutputWindowPane

           window = DTE.Windows.Item(EnvDTE.Constants.vsWindowKindOutput)

           window.Visible = True

           outputWindow = window.Object

           Try

               outputWindowPane = outputWindow.OutputWindowPanes.Item(Name)

           Catch e As System.Exception

               outputWindowPane = outputWindow.OutputWindowPanes.Add(Name)

           End Try

           outputWindowPane.Activate()

           Return outputWindowPane

       End Function

    End Module

  • Thanks for the spell checker tool. I have been looking for one for so long.  I wish that the next VS would include this spell checker.

  • I have installed version 2.2 as we are using VS 2008 SP1 and I get the spell checker in the menu and it acts like it is checking the first time I click on it but it never finds mispelled words.  I am in source view.

Page 2 of 2 (27 items) 12