I'm imlementing a feature akin to delimiter highlighting, but for the scope blocks of a custom Lua syntax language, by matching with the block nodes in my abstract syntax tree. However, my highlight adornments aren't moving in tandem with the tagged text they represent.
I've created a ScopeHighlightTagger class that inherits from TaggerBase and does offset comparisons between the snapshot ranges passed into GetTags and the AST block nodes accessible from its Document. There are also a ScopeHighlightTag that inherits ITag and a ScopeHighlightAdornmentManager that inherits DecorationAdornmentManagerBase. The adornment manager has an adornment draw callback that calls FillRectangle on the TextViewDrawContext.
It works, but the tags are only updating as their line of text is being modified. When the window scrolls or new lines are inserted above, the colored rects become misaligned with the lines of text they correspond with until you start typing in that line.
How can I get the tags to redraw their positions more dynamically, when the contents of the window shift around, instead of just when modifying the lines of text that they are tied to?