Bug Report T701852
Visible to All Users

Spell Checker: The "SpellCheckerCodeFixProvider encountered an error and has been disabled." error occurs after correcting a misspelled word in the comments section

created 6 years ago

[DevExpress Support Team: CLONED FROM T699296: Visual Studio Extremely slow after DevEx install]
I downloaded and installed CodeRush 18.2.4.18346.  The problem I am having is after correcting a misspelled word in a comments section.  I either get a "Please wait for an editor command to finish…" message or a "Committing Line" message.  Each message takes about 8 seconds to complete.

I did get a " 'SpellCheckerCodeFixProvider' encountered an error and has been disabled. " error.  I copied the Stack Trace:
----------
System.AggregateException : One or more errors occurred. ---> Object reference not set to an instance of an object.
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout,CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.InvokeWorker(Func`1 getFromDocument,IProgressTracker progressTracker,CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.<>c__DisplayClass18_0.<InvokeCore>b__0()
   at Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformAction(IExtensionManager extensionManager,Object extension,Action action)
---> (Inner Exception #0) System.NullReferenceException : Object reference not set to an instance of an object.
   at DevExpress.Internal.WeakEventHandlerBase`1.Invoke(Invoker invoker)
   at DevExpress.Internal.WeakEventHandlerStrategy`2.Raise(Object sender,TArgs args)
   at DevExpress.XtraSpellChecker.SpellCheckerCustomDictionary.RaiseWordAddedEvent(String word)
   at DevExpress.XtraSpellChecker.SpellCheckerCustomDictionary.OnWordAdded(String word)
   at DevExpress.XtraSpellChecker.SpellCheckerCustomDictionary.AddWord(String word)
   at DevExpress.CodeRush.VSFeatures.SpellChecker.SpellCheckerFactory.AddToDictionary(String word)
   at DevExpress.CodeRush.VSFeatures.SpellChecker.SpellItemChecker.AddToDictionary(String word)
   at DevExpress.CodeAnalysis.VisualBasic.Diagnostics.SpellChecker.SpellCheckerCodeFixProvider.AddToDictionaryOperation.Apply(Workspace workspace,CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CodeActions.CodeActionOperation.TryApply(Workspace workspace,IProgressTracker progressTracker,CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Editor.Implementation.CodeActions.CodeActionEditHandlerService.ProcessOperations(Workspace workspace,ImmutableArray`1 operations,IProgressTracker progressTracker,CancellationToken cancellationToken)
   at async Microsoft.CodeAnalysis.Editor.Implementation.CodeActions.CodeActionEditHandlerService.ApplyAsync(<Unknown Parameters>)<---

---------

Comments (3)
DevExpress Support Team 6 years ago

    Hello,

    Currently, we not able to reproduce this issue locally, however, we have made several changes in the spell checker code.
    Would you please try the following daily build and see if this issue is still reproducible: DevExpress.CodeRush.Roslyn-18.2.5.18354.vsix

    EA EA
    Eric Adolphson 6 years ago

      CodeRush ver 18.2.4.18346

      Only quick setting enabled:
        Clipboard History
        Spell checker
        Templates

      Sometimes spell check does not show errors until first edit is made, but could not get this to repeat every time

      AboutBox.vb
        Version 5
          Version 5.0.2.x
        Version 5.0.2.2
          PrintXuc.vb
        Private Function GetManager()
          Dim bsvc
        Add to dictionary: bsvc

      'SpellCheckedCodrFixProvider' encountered an error and has been disabled.
      System.AggregateException : One or more errors occurred. ---> Object reference not set to an instance of an object.
         at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
         at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout,CancellationToken cancellationToken)
         at Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.InvokeWorker(Func`1 getFromDocument,IProgressTracker progressTracker,CancellationToken cancellationToken)
         at Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.<>c__DisplayClass18_0.<InvokeCore>b__0()
         at Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformAction(IExtensionManager extensionManager,Object extension,Action action)
      ---> (Inner Exception #0) System.NullReferenceException : Object reference not set to an instance of an object.
         at DevExpress.Internal.WeakEventHandlerBase`1.Invoke(Invoker invoker)
         at DevExpress.Internal.WeakEventHandlerStrategy`2.Raise(Object sender,TArgs args)
         at DevExpress.XtraSpellChecker.SpellCheckerCustomDictionary.RaiseWordAddedEvent(String word)
         at DevExpress.XtraSpellChecker.SpellCheckerCustomDictionary.OnWordAdded(String word)
         at DevExpress.XtraSpellChecker.SpellCheckerCustomDictionary.AddWord(String word)
         at DevExpress.CodeRush.VSFeatures.SpellChecker.SpellCheckerFactory.AddToDictionary(String word)
         at DevExpress.CodeRush.VSFeatures.SpellChecker.SpellItemChecker.AddToDictionary(String word)
         at DevExpress.CodeAnalysis.VisualBasic.Diagnostics.SpellChecker.SpellCheckerCodeFixProvider.AddToDictionaryOperation.Apply(Workspace workspace,CancellationToken cancellationToken)
         at Microsoft.CodeAnalysis.CodeActions.CodeActionOperation.TryApply(Workspace workspace,IProgressTracker progressTracker,CancellationToken cancellationToken)
         at Microsoft.CodeAnalysis.Editor.Implementation.CodeActions.CodeActionEditHandlerService.ProcessOperations(Workspace workspace,ImmutableArray`1 operations,IProgressTracker progressTracker,CancellationToken cancellationToken)
         at async Microsoft.CodeAnalysis.Editor.Implementation.CodeActions.CodeActionEditHandlerService.ApplyAsync(<Unknown Parameters>)<---

      Crashed repeated multiple times.

      CodeRush ver 18.2.5.18354

      Only quick settings enabled:
        Clipboard History
        Spell checker
        Templates

      Sometimes spell check does not show errors until first edit is made, but could not get this to repeat every time

      Added "bsvc" to dictionary without crash

      Used Notepad++ to deleted "bsvc" from custom dictionary to re-test.

      On second test, was able to add "bsvc" without crash, but "bsvc" was still marked a misspelled.
      Moved mouse to "bsvc" in code, and got CodeRush prompt for misspelled word.
      Clicked on drop down arrow to get list of correctly spelled words, and "bsvc" was at the top of the list.
      "Add to dictionary" is not in the list.
      Looked at the contents of Custom.dic, and "bsvc" not in list.

      3rd time adding "bsvc" to dictionary everything worked.

      Fourth time got a repeat of the second test.
      Fourth test also had spell check not show errors until first edit is made.  I don't know if the "not showing until edit is made" is related to "Add to dictionary" not working.

      5th time adding "bsvc" to dictionary everything worked, and spell check showed errors BEFORE i made any edits.

      I am including the AboutBox form, and my custom dictionary AFTER I deleted "bsvc"

      DevExpress Support Team 6 years ago

        Eric,

        Thank you for additional information. I was able to reproduce this issue on my machine.
        Please give us some time to research and fix this issue.

        Answers approved by DevExpress Support

        created 6 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

        Additional information:

        Hi Eric,
        We researched the issue and made changes in our code and the issue doesn't occur now. We prepared a build with the latest changes and suggest you try it:
        http://downloads.devexpress.com/Share/IDE/181226/DevExpress.CodeRush.Roslyn-18.2.5.18360.exe
        Please inform us about your experience.

          Show previous comments (9)
          PW PW
          Przemyslaw Wlodarczak (DevExpress) 6 years ago

            Eric,

            I am happy to hear that the issue is resolved now.
            Do not hesitate to contact us if you face any difficulties with our tools. We will always be happy to help.

            EA EA
            Eric Adolphson 4 years ago

              My spell checker is turned off again. I have checked the settings, and for my project and a Visual Studio instance with NO project, spell checker is turned on.

              Extensions->Code Rush->Editor->All Languages->Code Analysis->Spell Checker.
              [X] Enable spell checker
              [X] Comments
              [X] String
              [X] Verbatim strings

              I think it got turned off when I updated Code Rush to 20.2.3. I just installed 20.2.4 to see if that would fix my problem. but it did not.

              DevExpress Support Team 4 years ago

                Hello,

                I've created a separate ticket on your behalf (T952032: Spell Checker - Does not work in the editor.). It has been placed in our processing queue and will be answered shortly.

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.