Posted 18 years ago
by Bob Puckett
Version: 4.0.0250
Platform: .NET 2.0
Environment: Windows XP (32-bit)
My compiler reports the starting and ending offset of each token and when an error occurs, I want to indicate the position in the edtor. Here is my code:
However, the squiggle doesn't appear where I expect it to. It appears to be drawn several spaces farther in the text that I expected. It appears that the offset is farther depending on what line the the document it is on.
Is it possible that the editor is counting characters that my scanner does not see? This worked correctly before updating my code to 4.0. I count the characters in the editor and my offsets appear to be correct.
Is there a property that I have set incorrectly?
It also appears that the length of the span is 1 less than it should be. If the starting offset is 19 and the end is 22, it appears to underline just 3 characters. If the error starts and ends at the same spot becuase it is only 1 character, the indicator does not appear at all.
The same behavior is true for WaveLineSpanIndicator.
CompilerErrorSpanIndicator indicator = new CompilerErrorSpanIndicator();
myDocumentEditor.Document.SpanIndicatorLayers[0].Add(indicator, new TextRange(sender.OffendingToken.StartPosition, sender.OffendingToken.EndPosition));
Is it possible that the editor is counting characters that my scanner does not see? This worked correctly before updating my code to 4.0. I count the characters in the editor and my offsets appear to be correct.
Is there a property that I have set incorrectly?
It also appears that the length of the span is 1 less than it should be. If the starting offset is 19 and the end is 22, it appears to underline just 3 characters. If the error starts and ends at the same spot becuase it is only 1 character, the indicator does not appear at all.
The same behavior is true for WaveLineSpanIndicator.