Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When renaming an identifier using Visual Studio keyboard shortcut Ctrl+R,R, the extension crash due to a NullReferenceException #8

Open
walterlv opened this issue Jul 10, 2019 · 2 comments

Comments

@walterlv
Copy link

Installed product versions

  • Visual Studio: 2019 Professional
  • This extension: 1.0.43

Description

When renaming an identifier using Visual Studio keyboard shortcut Ctrl+R,R, the extension crash due to a NullReferenceException.

image

Steps to recreate

  1. Press Ctrl+R, R to rename an identifier
  2. type a new identifier
  3. during the typing, you'll find that the visual studio hang for a while
  4. After the hanging, we can see that Visual Studio detected an exception
  5. View the log file and find that NamR crashes.

Current behavior

This is the exception below.

System.NullReferenceException:

NamR.CompletionCommandHandler.TriggerCompletion()
NamR.CompletionCommandHandler.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
Microsoft.VisualStudio.Editor.Implementation.Intellisense.MultiCaretPreemptingFilterProvider.MultiCaretPreemptingFilter.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
Microsoft.VisualStudio.Editor.Implementation.SimpleTextViewWindow.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
Microsoft.VisualStudio.Editor.Implementation.VsKeyboardFilter.SendCommand(Guid cmdGroup, UInt32 cmdID, Object inParam)
Microsoft.VisualStudio.Editor.Implementation.VsKeyboardFilter.TextInput(TextCompositionEventArgs args)
Microsoft.VisualStudio.Text.Editor.Implementation.KeyProcessorDispatcher.<><DispatchTextInputEvents>b__6_0(KeyProcessor p, TextCompositionEventArgs args)
Microsoft.VisualStudio.Text.Editor.Implementation.KeyProcessorDispatcher.<>c__DisplayClass10_1`1.<Dispatch>b__0()
Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call)
Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)

Expected behavior

No exception.

@walterlv
Copy link
Author

I didn't view your code but I guess that the main reason is that I'm editing multiple places but you only handle one.

If you need, I'll view the code and fix it myself.

@GKotfis
Copy link

GKotfis commented Jul 11, 2019

Similar behavior when trying to use refactorings like 'Extract to method' or snippets 'propfull'.
VS2019 16.1.5
Exception:

System.NullReferenceException: Object reference not set to an instance of an object.&#x000D;&#x000A;   at NamR.CompletionCommandHandler.TriggerCompletion()&#x000D;&#x000A;   at NamR.CompletionCommandHandler.Exec(Guid&amp; pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)&#x000D;&#x000A;   at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid&amp; pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)&#x000D;&#x000A;   at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(Guid&amp; pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)&#x000D;&#x000A;   at Microsoft.VisualStudio.Editor.Implementation.Intellisense.MultiCaretPreemptingFilterProvider.MultiCaretPreemptingFilter.Exec(Guid&amp; pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)&#x000D;&#x000A;   at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid&amp; pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)&#x000D;&#x000A;   at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid&amp; pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)&#x000D;&#x000A;   at Microsoft.VisualStudio.Editor.Implementation.SimpleTextViewWindow.Exec(Guid&amp; pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)&#x000D;&#x000A;   at Microsoft.VisualStudio.Editor.Implementation.VsKeyboardFilter.SendCommand(Guid cmdGroup, UInt32 cmdID, Object inParam)&#x000D;&#x000A;   at Microsoft.VisualStudio.Editor.Implementation.VsKeyboardFilter.TextInput(TextCompositionEventArgs args)&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Editor.Implementation.KeyProcessorDispatcher.&lt;&gt;c.&lt;DispatchTextInputEvents&gt;b__6_0(KeyProcessor p, TextCompositionEventArgs args)&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Editor.Implementation.KeyProcessorDispatcher.&lt;&gt;c__DisplayClass10_1`1.&lt;Dispatch&gt;b__0()&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call)&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)

Right now I need to disable it :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants