Exemple #1
0
        IEnumerable <ITagSpan <TermTag> > ITagger <TermTag> .GetTags(NormalizedSnapshotSpanCollection spans) =>
        spans
        .SelectMany(curSpan =>
                    _getColor(curSpan.GetText(), curSpan.Start)
                    .Select(termColor =>
        {
            var todoSpan = new SnapshotSpan(curSpan.Snapshot, new Span(termColor.StartPos - 1, termColor.Length));

            return(new TagSpan <TermTag>(todoSpan, new TermTag(termColor.Classifier)));
        }));
Exemple #2
0
        internal IEnumerable <ClassifiedSpan> GetIdentifiersInSpans(Workspace workspace, SemanticModel model, NormalizedSnapshotSpanCollection spans)
        {
            var classifiedSpans = spans.SelectMany(span =>
            {
                var textSpan = TextSpan.FromBounds(span.Start, span.End);
                return(Classifier.GetClassifiedSpans(model, textSpan, workspace));
            });

            return(classifiedSpans.Where(span => ColorCoderClassificationTypeNames.SupportedClassificationTypeNames.Contains(span.ClassificationType,
                                                                                                                             StringComparer.InvariantCultureIgnoreCase)));
        }
Exemple #3
0
 public IEnumerable <ITagSpan <ClassificationTag> > GetTags(NormalizedSnapshotSpanCollection spans)
 {
     if (spans.Count == 0)
     {
         yield break;
     }
     foreach (var classificationSpan in spans.SelectMany(GetClassificationSpans))
     {
         yield return(new TagSpan <ClassificationTag>(classificationSpan.Span, new ClassificationTag(classificationSpan.ClassificationType)));
     }
 }
        public IEnumerable <ITagSpan <GherkinTokenTag> > GetTags(NormalizedSnapshotSpanCollection spans)
        {
            var tags = new List <ITagSpan <GherkinTokenTag> >();

            if (spans.Any())
            {
                var events = tokenParser.Events;
                tags.AddRange(spans.SelectMany(_ => gherkinStepTagger.CreateTags(events, _)));
            }
            return(tags);
        }
Exemple #5
0
        internal IEnumerable <ClassifiedSpan> GetIdentifiersInSpans(Workspace workspace, SemanticModel model, NormalizedSnapshotSpanCollection spans)
        {
            var comparer = StringComparer.InvariantCultureIgnoreCase;

            var classifiedSpans = spans.SelectMany(span =>
            {
                var textSpan = TextSpan.FromBounds(span.Start, span.End);
                return(Classifier.GetClassifiedSpans(model, textSpan, workspace));
            });

            return(classifiedSpans.Where(c => comparer.Compare(c.ClassificationType, "identifier") == 0));
        }
        public IEnumerable <ITagSpan <NaturalTextTag> > GetTags(NormalizedSnapshotSpanCollection spans)
        {
            NormalizedSnapshotSpanCollection classifiedSpans = new NormalizedSnapshotSpanCollection(
                spans.SelectMany(span => _aggregator.GetClassificationSpans(span))
                .Select(c => c.Span));

            NormalizedSnapshotSpanCollection plainSpans = NormalizedSnapshotSpanCollection.Difference(spans, classifiedSpans);

            foreach (var span in plainSpans)
            {
                yield return(new TagSpan <NaturalTextTag>(span, new NaturalTextTag()));
            }
        }
Exemple #7
0
        private IEnumerable <ITagSpan <TTag> > GetTags(NormalizedSnapshotSpanCollection col)
        {
            AdjustRequestSpan(col);
            if (col.Count == 0)
            {
                return(Enumerable.Empty <ITagSpan <TTag> >());
            }

            // Even though it's easier don't do a GetTags request for the overarching SnapshotSpan
            // of the request.  It's possible for the overarching SnapshotSpan to have an order
            // magnitudes more lines than the items in the collection.  This is very possible when
            // large folded regions or on screen.  Instead just request the individual ones
            return(col.Count == 1
                ? _basicTaggerSource.GetTags(col[0])
                : col.SelectMany(_basicTaggerSource.GetTags));
        }
Exemple #8
0
 public IEnumerable <ITagSpan <TTag> > GetTags(NormalizedSnapshotSpanCollection spans)
 {
     return(spans.SelectMany(GetTags));
 }
 public IEnumerable <ITagSpan <ErrorTag> > GetTags(NormalizedSnapshotSpanCollection spans)
 {
     return(spans.SelectMany(s => Editor.Instance.GetSyntaxErrorTags(buffer, s)));
 }
 public IEnumerable<LanguageToken> GetTokens(NormalizedSnapshotSpanCollection spans)
 {
     return spans.SelectMany(GetTokens);
 }
 IEnumerable <ITagSpan <IntraTextAdornmentTag> > ITagger <IntraTextAdornmentTag> .GetTags(NormalizedSnapshotSpanCollection spans)
 {
     return(spans.SelectMany(GetTags));
 }
Exemple #12
0
 public IEnumerable <ITagSpan <T> > GetTags(NormalizedSnapshotSpanCollection spans) =>
 spans.SelectMany(a => Tags(a.Span));