terrajobst / nquery-vnext

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

ArgumentOutOfRangeException in VS Editor caused by NQuerySignatureHelpSource #55

Closed dallmair closed 1 month ago

dallmair commented 2 years ago

Editor content:

SELECT  *
FROM    Categories c
        INNER JOIN CustomerCustomerDemo ccd ON TO_STRING(c.CategoryID = ccd.CustomerID

Was thrown when I had the join condition without TO_STRING (i.e. ON c.CategoryID = ccd.CustomerID), then went right after the ON and typed <space>TO_STR<Enter>(<Del>.

Exception message: Specified argument was out of the range of valid values. (Parameter 'span')

   at Microsoft.VisualStudio.Text.Implementation.TrackingSpan..ctor(ITextVersion version, Span span, SpanTrackingMode trackingMode)
   at Microsoft.VisualStudio.Text.Implementation.TextVersion.CreateTrackingSpan(Int32 start, Int32 length, SpanTrackingMode trackingMode)
   at NQuery.Authoring.VSEditorWpf.SignatureHelp.NQuerySignatureHelpSource.AugmentSignatureHelpSession(ISignatureHelpSession session, IList`1 signatures) in D:\Source\nquery-vnext\src\NQuery.Authoring.VSEditorWpf\SignatureHelp\NQuerySignatureHelpSource.cs:line 38
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.SignatureHelpSession.Recalculate()
   at NQuery.Authoring.VSEditorWpf.SignatureHelp.SignatureHelpManager.UpdateSession() in D:\Source\nquery-vnext\src\NQuery.Authoring.VSEditorWpf\SignatureHelp\SignatureHelpManager.cs:line 124
   at NQuery.Authoring.VSEditorWpf.SignatureHelp.SignatureHelpManager.TextBufferOnPostChanged(Object sender, EventArgs e) in D:\Source\nquery-vnext\src\NQuery.Authoring.VSEditorWpf\SignatureHelp\SignatureHelpManager.cs:line 51
   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent(Object sender, EventHandler eventHandlers)
terrajobst commented 2 years ago

Hmm, I can't reproduce this:

Animation

dallmair commented 2 years ago

Are you running it under the debugger? Repro works for me very time:

Animation