private void AddClassifiedSpansForCurrentTree( IClassificationService classificationService, SnapshotSpan span, Document document, List <ClassifiedSpan> classifiedSpans) { if (!_lastLineCache.TryUseCache(span, out var tempList)) { tempList = ClassificationUtilities.GetOrCreateClassifiedSpanList(); classificationService.AddSyntacticClassificationsAsync( document, span.Span.ToTextSpan(), tempList, CancellationToken.None).Wait(CancellationToken.None); _lastLineCache.Update(span, tempList); } // simple case. They're asking for the classifications for a tree that we already have. // Just get the results from the tree and return them. classifiedSpans.AddRange(tempList); }
protected override async Task AddClassificationsAsync(IClassificationService classificationService, Document document, TextSpan textSpan, List <ClassifiedSpan> spans, CancellationToken cancellationToken) { await classificationService.AddSyntacticClassificationsAsync(document, textSpan, spans, cancellationToken).ConfigureAwait(false); }
public async Task AddSyntacticClassificationsAsync(Document document, TextSpan textSpan, List <ClassifiedSpan> result, CancellationToken cancellationToken) => await _originalService.AddSyntacticClassificationsAsync(document, textSpan, result, cancellationToken).ConfigureAwait(false);