Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

How to highlight a single word in a specific file?

$
0
0

I saw the example of searching and highlighting all the words using the ITagger<T> interface, however, in my case I only need to highlight specific words in specific document (whose path I only know during the runtime). However, if I use:

    [Export(typeof(IViewTaggerProvider))]
    [ContentType("code")]
    [TagType(typeof(HighlightWordTag))]privateclass HighlightWordTaggerProvider : IViewTaggerProvider

Then it creates ITagger<T> for ALL the documents and forces me to check in each ITagger<T> whether I am in the right file. Is there a way to create an ITagger and attach it to a specific document during runtime, to an already open document (EditView)? If so, how can I do that?

Thanks!
Vitaly


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>