示例#1
0
        private IList <ClassificationSpan> GetClassificationSpansSync(SnapshotSpan parentSpan)
        {
            IAccurateClassifier accurateClassifier = _classifier as IAccurateClassifier;

            if (accurateClassifier != null && _waitIndicator != null)
            {
                using (var waitContext = WaitHelper.Wait(_waitIndicator, "HTML Copy", "Formatting document for copying"))
                {
                    return(accurateClassifier.GetAllClassificationSpans(parentSpan, waitContext.CancellationToken));
                }
            }

            return(_classifier.GetClassificationSpans(parentSpan));
        }
示例#2
0
        public IEnumerable <ITagSpan <ClassificationTag> > GetAllTags(NormalizedSnapshotSpanCollection spans, CancellationToken cancel)
        {
            foreach (IClassifier classifier in Classifiers)
            {
                IAccurateClassifier classifier2 = classifier as IAccurateClassifier;

                foreach (var snapshotSpan in spans)
                {
                    foreach (var classificationSpan in (classifier2 != null)
                                                       ? classifier2.GetAllClassificationSpans(snapshotSpan, cancel)
                                                       : classifier.GetClassificationSpans(snapshotSpan))
                    {
                        yield return(new TagSpan <ClassificationTag>(
                                         classificationSpan.Span,
                                         new ClassificationTag(classificationSpan.ClassificationType)));
                    }
                }
            }
        }