I have implemented custom tagger, inheriting from TaggerBase<ISquiggleTag>. It performs relatively heavy work (spell check of the whole text range passed in, usually it's a sentence or paragrahp), so instead of doing that inside tagger directly, I first check if I have a cached set of tags for given text range. If not - I perform work asynchronously and return no tags for this range. When asynchronous work is done (I calculated tags for given range) - I call OnTagsChanged for this range, so GetTags are called again, but this time I certainly have text range in cache. All this works fine (or at least it looks like it).
Next I want to show quick info for those squiggle tags. I add default SquiggleTagQuickInfoProvider, but it does not work, because it calls GetTags with text range of length 0 (so, with empty text range). So suppose I have text "one two three" and pointing my mouse to letter "t" in word "two". Then SquiggleTagQuickInfoProvider will call GetTags with text range with offset 4 and length 0.
My questions are:
1. Is it reasonable to implement asynchronous GetTags the way I did, or there are better ways?
2. How can I get information about which tags are related to the given offset in text range? My GetTags calculate tags for the whole sentences\parahraphs and I cannot recalculate them for given position (offset). I need this info for quick info provider and also to display some information when user right-clicks something in the view (so, for context menu). So if I see my squiggle tags in view - I assume there is some way to get some kind of reference to them given offset. Alternatively, I can cache my tags myself in the tagger itself. But then - how can I remove items from that cache? So, how would I know if given tag\range are no longer used by the view.
[Modified 4 years ago]