SyntaxEditor for WPF Forum

Posted 6 years ago by Daisuke Nakada
Version: 18.1.0672


I just found out that there is a difference in the snapshot reader between before and after calling the PeekTokenReverse method on the ITextSnapshotReader.


How to reproduce it:

snapshot text: "a" (only one character)

reader offset: 1

call reader.PeekTokenReverse()


Before calling reader.PeekTokenReverse() is called, reader.IsAtTokenStart is true and reader.Token is {[MergableToken: (1, 1)]}. But after calling it, reader.IsAtTokenStart is false and reader.Token is null.


I'm seeing this in CSharpContextFactory.UpdateTargetExpression. Inside that method, reader.PeekTokenReverse() is called when the LexicalStateId of the token is DocumentEnd or LineTerminator.


Thank you.

Comments (2)

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA


Thanks for reporting this.  This only happens at the end of the document, right?  I believe we found the problem and fixed it for the next maintenance release.

Actipro Software Support

Posted 6 years ago by Daisuke Nakada

Right. That happens for the document end.

Thank you.

The latest build of this product (v24.1.2) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.