Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
Bug with SyntaxTree and TextDocument out of sync
posted

Hello,

first:

  • the problem can be reproduced with Infragistics 15.2.20152.1000
  • I attached a sample c# project that should compile after correcting infragistics dll references, with comments and a marked snippet where a breakpoint can be set to directly navigate to the issue

now to the problem:

  • certain TSQL scripts cause a bug to occur when using TextDocument.Language = TSqlLanguage.Instance
  • for those scripts, the SyntaxNode.SyntaxTree.Snapshot.GetText() returns garbage text at some point

The following is such a sample script. Without wrapping the case statement into brackets, or prefixing "name" as "rt.name", the .GetText function returns garbage after the code " and name in". With my breakpoint in the sample you can clearly see, that GetText returns "Y " instead of "BY" in the following nodes, and also the literals '123','456','789' are already split up in a weird way as in the span objects.

Thanks,

cppanda

BugSample.zip