EWSoftware / VSSpellChecker

A Visual Studio spell checker editor extension that checks the spelling of comments, strings, and plain text as you type. Supports configuration and various languages.
Other
377 stars 65 forks source link

Crash Hovering over Add to Ignore Words File #209

Closed davidbsanderson closed 4 years ago

davidbsanderson commented 4 years ago

In version 2020.3.28.0, Visual Studio Professional 2017 Version 15.9.20 is crashing whenever hovering over the "Add to Ignore Words File" option in the spell checker popup.

An error is presented in Visual Studio which is recorded in the event log.

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentOutOfRangeException
   at System.Windows.Controls.ItemCollection.GetItemAt(Int32)
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.LightBulbMenuItem.FocusAndExpandSubmenu()
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.LightBulbMenuItem+<InitializeNonFlavoredAsync>d__18.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.LightBulbMenuItem+<InitializeAsync>d__17.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.LightBulb+<OnMenuItemGotKeyboardFocus>d__59.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
EWSoftware commented 4 years ago

I'm not able to duplicate this with 15.9.21. Are there multiple ignored words files or just the global one? Are there any particular steps you take to reproduce the issue?

davidbsanderson commented 4 years ago

I played around with it some more and was able to resolve it.

When the extension was updated, it did not create an IgnoredWords.dic file in \AppData\Local\EWSoftware\Visual Studio Spell Checker. I went into Configuration Settings > Ignored Words and clicked Edit on the Ignored Words File, which asked if I wanted to create the file since it didn't exist. After doing so, the popup now displays "Add to Ignored Words File Global" and does not crash upon hover. Before, it must have thought I had multiple files because it was attempting to display a dropdown upon hover instead of saying "Global".

EWSoftware commented 4 years ago

Thanks. I'll check on that as it shouldn't need to exist.

srupprecht1 commented 4 years ago

I had the same issue in VS2019 and @davidbsanderson solution solves this for me.

PropelledDog commented 4 years ago

Hey @srupprecht1 I am using VS2019 too, but I am not able to find the configuration options for this extension. @davidbsanderson stated the following:

"I went into Configuration Settings > Ignored Words and clicked Edit on the Ignored Words File [...]"

Where are the configuration settings? Was @davidbsanderson talking about the "Properties" when you right click on a project solution? I don't see any such configuration options there.

Where is this "Ignored Words" setting in Visual Studio 2019?

EWSoftware commented 4 years ago

Go to the Tools menu, select Spell Checker, and then Edit Global Configuration.