public IEnumerable <ITagSpan <ITextMarkerTag> > GetTags(ActiveStatementTagger tagger, NormalizedSnapshotSpanCollection spans)
        {
            if (activeStatements.Count == 0 || spans.Count == 0)
            {
                yield break;
            }

            //TODO: This code shouldn't depend on IDocumentViewer
            var docViewer = tagger.TextView.TextBuffer.TryGetDocumentViewer();

            if (docViewer == null)
            {
                yield break;
            }

            var methodDebugService = docViewer.TryGetMethodDebugService();

            if (methodDebugService == null)
            {
                yield break;
            }

            var         snapshot  = spans[0].Snapshot;
            MethodDef   method    = null;
            List <uint> ilOffsets = null;

            foreach (var span in spans)
            {
                foreach (var info in methodDebugService.GetStatementsByTextSpan(span.Span))
                {
                    if (info.Method != method)
                    {
                        method = info.Method;
                        var moduleTokenId = new ModuleTokenId(moduleIdProvider.Create(method.Module), method.MDToken);
                        if (!activeStatements.TryGetValue(moduleTokenId, out ilOffsets))
                        {
                            continue;
                        }
                    }
                    else if (ilOffsets == null)
                    {
                        continue;
                    }
                    var textSpan = info.Statement.TextSpan;
                    if (textSpan.End > snapshot.Length)
                    {
                        yield break;                        // Old data, but we'll get called again
                    }
                    var binSpan = info.Statement.BinSpan;
                    foreach (uint ilOffset in ilOffsets)
                    {
                        if (ilOffset >= binSpan.Start && ilOffset < binSpan.End)
                        {
                            yield return(new TagSpan <ITextMarkerTag>(new SnapshotSpan(snapshot, textSpan.Start, textSpan.Length), activeStatementTextMarkerTag));
                        }
                    }
                }
            }
        }
 public void OnDisposed(ActiveStatementTagger tagger) => taggers.Remove(tagger);
 public void OnCreated(ActiveStatementTagger tagger) => taggers.Add(tagger);