diff --git a/src/EditorFeatures/CSharpTest/Interactive/BraceMatching/InteractiveBraceHighlightingTests.cs b/src/EditorFeatures/CSharpTest/Interactive/BraceMatching/InteractiveBraceHighlightingTests.cs index d3128947411d1d6c3f4affa47b5cb2ef4cf8c0b6..92edfc124118559949f315ed12d2d1aed5c484e6 100644 --- a/src/EditorFeatures/CSharpTest/Interactive/BraceMatching/InteractiveBraceHighlightingTests.cs +++ b/src/EditorFeatures/CSharpTest/Interactive/BraceMatching/InteractiveBraceHighlightingTests.cs @@ -42,7 +42,7 @@ private IEnumerable Enumerable(params T[] array) var context = new TaggerContext( buffer.CurrentSnapshot.GetRelatedDocumentsWithChanges().FirstOrDefault(), buffer.CurrentSnapshot, new SnapshotPoint(buffer.CurrentSnapshot, position)); - producer.ProduceTagsAsync(context).Wait(); + producer.ProduceTagsAsync_ForTestingPurposesOnly(context).Wait(); return context.tagSpans; } diff --git a/src/EditorFeatures/Core/Implementation/Classification/SemanticClassificationTaggerProvider.cs b/src/EditorFeatures/Core/Implementation/Classification/SemanticClassificationTaggerProvider.cs index ebe43151da19768168afc3574fb145eae7e4edeb..55192b1ffd394f6c93b8c3b9f8cb8a946ccbc8a2 100644 --- a/src/EditorFeatures/Core/Implementation/Classification/SemanticClassificationTaggerProvider.cs +++ b/src/EditorFeatures/Core/Implementation/Classification/SemanticClassificationTaggerProvider.cs @@ -65,7 +65,7 @@ protected override ITaggerEventSource CreateEventSource(ITextView textViewOpt, I TaggerEventSources.OnDocumentActiveContextChanged(subjectBuffer, TaggerDelay.Short)); } - protected internal override async Task ProduceTagsAsync(TaggerContext context) + protected override async Task ProduceTagsAsync(TaggerContext context) { Debug.Assert(context.SpansToTag.IsSingle()); Debug.Assert(context.CaretPosition == null); diff --git a/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/ReferenceHighlightingViewTaggerProvider.cs b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/ReferenceHighlightingViewTaggerProvider.cs index 96b9516902b974cdf36c604f12d9ae9f4bb7adec..cf4799fa53433dc9ddbbf55da05f2b73c64aa435 100644 --- a/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/ReferenceHighlightingViewTaggerProvider.cs +++ b/src/EditorFeatures/Core/Implementation/ReferenceHighlighting/ReferenceHighlightingViewTaggerProvider.cs @@ -69,7 +69,7 @@ protected override IEnumerable GetSpansToTag(ITextView textViewOpt .ToList(); } - protected internal override Task ProduceTagsAsync(TaggerContext context) + protected override Task ProduceTagsAsync(TaggerContext context) { // NOTE(cyrusn): Normally we'd limit ourselves to producing tags in the span we were // asked about. However, we want to produce all tags here so that the user can actually diff --git a/src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.Tagger.cs b/src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.Tagger.cs index 99f32b9b676326f6f13fbfdebb05d85c2c2a63c6..828b33d49ac4e58c44f011aafa7b0751a237f89f 100644 --- a/src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.Tagger.cs +++ b/src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.Tagger.cs @@ -133,14 +133,14 @@ public IEnumerable> GetAllTags(NormalizedSnapshotSpanCollection r return SpecializedCollections.EmptyEnumerable>(); } - var result = GetTags(requestedSpans, tags); + var result = GetIntersectingTagSpans(requestedSpans, tags); DebugVerifyTags(requestedSpans, result); return result; } - private static IEnumerable> GetTags(NormalizedSnapshotSpanCollection requestedSpans, TagSpanIntervalTree tags) + private static IEnumerable> GetIntersectingTagSpans(NormalizedSnapshotSpanCollection requestedSpans, TagSpanIntervalTree tags) { // Special case the case where there is only one requested span. In that case, we don't // need to allocate any intermediate collections diff --git a/src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.cs b/src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.cs index 18b6226a85c0bc897d513b7e141639114faea8ef..34dfb6d0182d19de03ffd485b0ffb77e2e3309ac 100644 --- a/src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.cs +++ b/src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.cs @@ -174,11 +174,15 @@ protected virtual IEnumerable GetSpansToTag(ITextView textViewOpt, /// protected abstract ITaggerEventSource CreateEventSource(ITextView textViewOpt, ITextBuffer subjectBuffer); + internal Task ProduceTagsAsync_ForTestingPurposesOnly(TaggerContext context) + { + return ProduceTagsAsync(context); + } + /// /// Produce tags for the given context. /// - // internal for testing purposes only. - protected internal virtual async Task ProduceTagsAsync(TaggerContext context) + protected virtual async Task ProduceTagsAsync(TaggerContext context) { foreach (var spanToTag in context.SpansToTag) { diff --git a/src/EditorFeatures/Test/BraceHighlighting/AbstractBraceHighlightingTests.cs b/src/EditorFeatures/Test/BraceHighlighting/AbstractBraceHighlightingTests.cs index aee93610f5151e93ad9ee69af1369175e02007a7..bb5ccce8c451bd517830ff6cde4a6907ccd32b2a 100644 --- a/src/EditorFeatures/Test/BraceHighlighting/AbstractBraceHighlightingTests.cs +++ b/src/EditorFeatures/Test/BraceHighlighting/AbstractBraceHighlightingTests.cs @@ -27,7 +27,7 @@ protected void TestBraceHighlighting(string markup) var context = new TaggerContext( document, buffer.CurrentSnapshot, new SnapshotPoint(buffer.CurrentSnapshot, testDocument.CursorPosition.Value)); - provider.ProduceTagsAsync(context).Wait(); + provider.ProduceTagsAsync_ForTestingPurposesOnly(context).Wait(); var expectedHighlights = testDocument.SelectedSpans.Select(ts => ts.ToSpan()).OrderBy(s => s.Start).ToList(); var actualHighlights = context.tagSpans.Select(ts => ts.Span.Span).OrderBy(s => s.Start).ToList(); diff --git a/src/EditorFeatures/Test/Outlining/OutliningTaggerTests.cs b/src/EditorFeatures/Test/Outlining/OutliningTaggerTests.cs index f3176ecaa759660ee464690e7ba6ef7c2d845962..08f0f33888bea6add7e072fa2ebcefc221473013 100644 --- a/src/EditorFeatures/Test/Outlining/OutliningTaggerTests.cs +++ b/src/EditorFeatures/Test/Outlining/OutliningTaggerTests.cs @@ -142,7 +142,7 @@ private static List GetTagsFromWorkspace(TestWorkspace work var document = workspace.CurrentSolution.GetDocument(hostdoc.Id); var context = new TaggerContext(document, view.TextSnapshot); - provider.ProduceTagsAsync(context).Wait(); + provider.ProduceTagsAsync_ForTestingPurposesOnly(context).Wait(); return context.tagSpans.Select(x => x.Tag).ToList(); } diff --git a/src/EditorFeatures/Test2/KeywordHighlighting/AbstractKeywordHighlightingTests.vb b/src/EditorFeatures/Test2/KeywordHighlighting/AbstractKeywordHighlightingTests.vb index 24a1007e6116fdb978b69e914d4ab79f4b220557..46c4bc309849b19b45908e0af6fb0dfdc34e0e1e 100644 --- a/src/EditorFeatures/Test2/KeywordHighlighting/AbstractKeywordHighlightingTests.vb +++ b/src/EditorFeatures/Test2/KeywordHighlighting/AbstractKeywordHighlightingTests.vb @@ -35,7 +35,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.KeywordHighlighting AggregateAsynchronousOperationListener.EmptyListeners) Dim context = New TaggerContext(Of KeywordHighlightTag)(document, snapshot, New SnapshotPoint(snapshot, caretPosition)) - tagProducer.ProduceTagsAsync(context).Wait() + tagProducer.ProduceTagsAsync_ForTestingPurposesOnly(context).Wait() Dim producedTags = From tag In context.tagSpans Order By tag.Span.Start diff --git a/src/EditorFeatures/Test2/ReferenceHighlighting/AbstractReferenceHighlightingTests.vb b/src/EditorFeatures/Test2/ReferenceHighlighting/AbstractReferenceHighlightingTests.vb index 51204e67ff0ce2eac711bd15b9bb62f363a0a0eb..c1a71b85712dcae061447eb2af7fd04650d8b0c1 100644 --- a/src/EditorFeatures/Test2/ReferenceHighlighting/AbstractReferenceHighlightingTests.vb +++ b/src/EditorFeatures/Test2/ReferenceHighlighting/AbstractReferenceHighlightingTests.vb @@ -37,7 +37,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.ReferenceHighlighting Dim document = workspace.CurrentSolution.GetDocument(hostDocument.Id) Dim context = New TaggerContext(Of NavigableHighlightTag)( document, snapshot, New SnapshotPoint(snapshot, caretPosition)) - tagProducer.ProduceTagsAsync(context).Wait() + tagProducer.ProduceTagsAsync_ForTestingPurposesOnly(context).Wait() Dim producedTags = From tag In context.tagSpans Order By tag.Span.Start diff --git a/src/EditorFeatures/VisualBasicTest/BraceMatching/BraceHighlightingTests.vb b/src/EditorFeatures/VisualBasicTest/BraceMatching/BraceHighlightingTests.vb index a5341dd501af2aae069d8e1c9032fdfbd948820b..dce0556ee8ceedafd70c4ec4ef456c21480f4619 100644 --- a/src/EditorFeatures/VisualBasicTest/BraceMatching/BraceHighlightingTests.vb +++ b/src/EditorFeatures/VisualBasicTest/BraceMatching/BraceHighlightingTests.vb @@ -34,7 +34,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.BraceMatching Dim doc = buffer.CurrentSnapshot.GetRelatedDocumentsWithChanges().FirstOrDefault() Dim context = New TaggerContext(Of BraceHighlightTag)( doc, buffer.CurrentSnapshot, New SnapshotPoint(buffer.CurrentSnapshot, position)) - producer.ProduceTagsAsync(context).Wait() + producer.ProduceTagsAsync_ForTestingPurposesOnly(context).Wait() Return context.tagSpans End Function