|
5 | 5 | using Microsoft.VisualStudio.Text.Tagging; |
6 | 6 | using FineCodeCoverage.Engine.Model; |
7 | 7 | using System.Linq; |
8 | | -using Microsoft.VisualStudio.Shell; |
9 | 8 |
|
10 | 9 | namespace FineCodeCoverage.Impl |
11 | 10 | { |
12 | 11 | internal class CoverageLineGlyphTagger : ITagger<CoverageLineGlyphTag> |
13 | 12 | { |
14 | 13 | private readonly ITextBuffer _textBuffer; |
15 | 14 | private readonly IFCCEngine fccEngine; |
16 | | - private readonly ICoverageColoursProvider coverageColoursProvider; |
17 | 15 |
|
18 | 16 | public event EventHandler<SnapshotSpanEventArgs> TagsChanged; |
19 | 17 |
|
20 | | - public CoverageLineGlyphTagger(ITextBuffer textBuffer, IFCCEngine fccEngine, ICoverageColoursProvider coverageColoursProvider) |
| 18 | + public CoverageLineGlyphTagger(ITextBuffer textBuffer, IFCCEngine fccEngine) |
21 | 19 | { |
22 | 20 | _textBuffer = textBuffer; |
23 | 21 | this.fccEngine = fccEngine; |
24 | | - this.coverageColoursProvider = coverageColoursProvider; |
25 | 22 | fccEngine.UpdateMarginTags += FCCEngine_UpdateMarginTags; |
26 | 23 | } |
27 | 24 |
|
28 | 25 | private void FCCEngine_UpdateMarginTags(UpdateMarginTagsEventArgs e) |
29 | 26 | { |
30 | | -#pragma warning disable VSTHRD102 // Implement internal logic asynchronously |
31 | | - ThreadHelper.JoinableTaskFactory.Run(async () => |
32 | | -#pragma warning restore VSTHRD102 // Implement internal logic asynchronously |
33 | | - { |
34 | | - await coverageColoursProvider.PrepareAsync(); |
35 | | - var span = new SnapshotSpan(_textBuffer.CurrentSnapshot, 0, _textBuffer.CurrentSnapshot.Length); |
36 | | - var spanEventArgs = new SnapshotSpanEventArgs(span); |
37 | | - TagsChanged?.Invoke(this, spanEventArgs); |
38 | | - }); |
39 | | - |
| 27 | + var span = new SnapshotSpan(_textBuffer.CurrentSnapshot, 0, _textBuffer.CurrentSnapshot.Length); |
| 28 | + var spanEventArgs = new SnapshotSpanEventArgs(span); |
| 29 | + TagsChanged?.Invoke(this, spanEventArgs); |
40 | 30 | } |
41 | 31 |
|
42 | 32 | IEnumerable<ITagSpan<CoverageLineGlyphTag>> ITagger<CoverageLineGlyphTag>.GetTags(NormalizedSnapshotSpanCollection spans) |
|
0 commit comments