I have a tagger (subclass of ITagger) and I'm trying to call GetClassificationSpans, so I can use the classification to search for comments for formatting using tags. This worked in Visual Studio 2013, but now when it starts in Visual Studio 2015, GetClassificationSpans always returns an empty list - even when I examined the range in the debugger, and it definitely passes the range with a comment in it.
Does anyone know what could change in 2015 regarding the call to GetClassificationSpans?
BTW: I get the classifier by importing the IClassifierAggregatorService service in my tag provider (subclass ITaggerProvider) and passing it along with the tagger constructor:
[import] IClassifierAggregatorService aggregator;
Then I use the following call to tagger in the aggregator that I received from the provider:
IList<ClassificationSpan> lstClassifiers = aggregator.GetClassifier(span.Snapshot.TextBuffer).GetClassificationSpans(span);
And, as I said, the lstClassifiers list is always empty. Exactly the same code worked in VS2013. I can not find anything on the network that mentions any VS2015 changes that might cause this.
Thanks,
, . googling, , , ... , GetClassificationSpans() . MSFT , VS Connect.
GetClassificationSpans()
( MSFT) , TagAggregator IClassifier. :
TagAggregator
IClassifier
var service = container.GetService<IClassifierAggregatorService>(); var classifier = service.GetClassifier(textView.TextBuffer); var spans = classifier.GetClassificationSpans(new SnapshotSpan(...));
:
var service = container.GetService<IViewTagAggregatorFactoryService>(); var aggregator = service.CreateTagAggregator<IClassificationTag>(textView); var tags = aggregator.GetTags(new SnapshotSpan(...)));
IMappingTagSpan<IClassificationTag> ClassificationSpan, . , -, --- .. . (. VS Connect), .
IMappingTagSpan<IClassificationTag>
ClassificationSpan
. , , , :
, , .
, API- ITagger , "" . API, " , ". , , # VB, , VS2015 Roslyn, , GetClassificationSpans/GetTags , . API, IAccurateTagger, , , "" , , , .
VS2015, , , # VB, API- Roslyn, . , , , IAccurateTagger, , , - .
( , , , . VS2013, , # , .)
Source: https://habr.com/ru/post/1614888/More articles:Agar.io style ripple effect for canvas arcs - javascriptFailed to install Tesseract on Ubuntu 14.04 stray boxing - installationpip install from shortened URL - pythoniOS9 Segueing from UITableViewCell - iosPrevent Angular template with initial display - javascriptpyephem next_pass does not match the sky above - pythonКак создать массив строк с фиксированной длиной в C? - cselect random value based on probability of probability - sqlC: beginner confusion when working with character arrays - cError NestedScroll overlayTop AppBar - androidAll Articles