terrajobst / nquery-vnext

A Roslyn inspired rewrite of NQuery
MIT License
72 stars 16 forks source link

NullReferenceException in SignatureHelpManager.UpdateSession() #56

Open dallmair opened 2 years ago

dallmair commented 2 years ago

Was debugging and suddenly encountered this exception. One possible flow of events:

  1. UpdateSession() calls UpdateModel()
  2. UpdateModel() sets the Model property (to null in my case)
  3. The Model property determines hideSession = true and calls _session.Dismiss()
  4. As a consequence, SessionOnDismissed gets called, which sets _session to null
  5. In UpdateSession(), _session.Recalculate() cannot be called anymore

Note that UpdateSession probably wants to await UpdateModel, otherwise the session can be off.

   at NQuery.Authoring.VSEditorWpf.SignatureHelp.SignatureHelpManager.UpdateSession() in D:\Source\nquery-vnext\src\NQuery.Authoring.VSEditorWpf\SignatureHelp\SignatureHelpManager.cs:line 124

Was called from CaretOnPositionChanged.