Why pass in snapshotRanges in GetTags?

SyntaxEditor for WPF Forum

Posted 8 years ago by Craig - Varigence, Inc.
Version: 11.1.0545
Avatar
I'm writing a custom Tagger and I'm wondering why you guys chose to pass in a collection of snapshotRanges to GetTags. Looking at your sample, it seems like you use it to scan chunks of a file for text. But, you could just as easily scan the entire document. Is there a specific purpose or advantage to leveraging the snapshotRanges collection?

Thanks,

-Craig

[Modified at 09/28/2011 08:05 PM]

Comments (1)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Craig,

Our line layout code loops through each line and tries to obtain appropriate tags for each line. This way everything is more virtualized so we aren't collecting data for lines we don't need to display. For large files, this makes a huge performance difference.

If I recall correctly, it is ranges instead of a single range for scenarios like collapsed text, so that it can skip over those regions and just ask for data related to the before and after portions that end up on the same display line.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.