提交 06a9f17a 编写于 作者: S Sam Harwell

Remove unnecessary duplicate propagation of spansToTag

上级 8e22089f
......@@ -583,7 +583,7 @@ private IEnumerable<ITagSpan<TTag>> GetNonIntersectingTagSpans(IEnumerable<Snaps
oldState, spansToTag, caretPosition, textChangeRange, oldTagTrees, cancellationToken);
await ProduceTagsAsync(context).ConfigureAwait(false);
ProcessContext(spansToTag, oldTagTrees, context, initialTags);
ProcessContext(oldTagTrees, context, initialTags);
}
private bool ShouldSkipTagProduction()
......@@ -617,12 +617,11 @@ private void ProduceTagsSynchronously(TaggerContext<TTag> context)
}
private void ProcessContext(
ImmutableArray<DocumentSnapshotSpan> spansToTag,
ImmutableDictionary<ITextBuffer, TagSpanIntervalTree<TTag>> oldTagTrees,
TaggerContext<TTag> context,
bool initialTags)
{
var buffersToTag = spansToTag.Select(dss => dss.SnapshotSpan.Snapshot.TextBuffer).ToSet();
var buffersToTag = context.SpansToTag.Select(dss => dss.SnapshotSpan.Snapshot.TextBuffer).ToSet();
// Ignore any tag spans reported for any buffers we weren't interested in.
var newTagsByBuffer = context.tagSpans.Where(ts => buffersToTag.Contains(ts.Span.Snapshot.TextBuffer))
......@@ -630,7 +629,7 @@ private void ProduceTagsSynchronously(TaggerContext<TTag> context)
var newTagTrees = ConvertToTagTrees(oldTagTrees, newTagsByBuffer, context._spansTagged);
ProcessNewTagTrees(
spansToTag, oldTagTrees, newTagTrees,
context.SpansToTag, oldTagTrees, newTagTrees,
context.State, initialTags, context.CancellationToken);
}
......@@ -777,7 +776,7 @@ public TagSpanIntervalTree<TTag> GetAccurateTagIntervalTreeForBuffer(ITextBuffer
ProduceTagsSynchronously(context);
ProcessContext(spansToTag, oldTagTrees, context, initialTags: false);
ProcessContext(oldTagTrees, context, initialTags: false);
}
Debug.Assert(this.UpToDate);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册