private void OperationState_StateChanged(object sender, OperationStateChangedEventArgs e)
        {
            try
            {
                if (e.State == TestOperationStates.TestExecutionFinished)
                {
                    Logger.Clear();
                    Logger.Log("Updating coverage ...");

                    var operationType            = e.Operation.GetType();
                    var testConfiguration        = (operationType.GetProperty("Configuration") ?? operationType.GetProperty("Configuration", BindingFlags.Instance | BindingFlags.NonPublic)).GetValue(e.Operation);
                    var testConfigurationSources = (IEnumerable <string>)testConfiguration.GetType().GetProperty("TestSources").GetValue(testConfiguration);

                    foreach (var testDllFile in testConfigurationSources)
                    {
                        CoverageUtil.LoadCoverageFromTestDllFile(testDllFile, exception =>
                        {
                            if (exception != null)
                            {
                                Logger.Log(exception);
                                return;
                            }

                            TaggerProvider.ReloadTags();
                            Logger.Log("Coverage updated!");
                        });
                    }
                }
            }
            catch (Exception exception)
            {
                Logger.Log(exception);
            }
        }
        internal TestContainerDiscoverer
        (
            [Import(typeof(IOperationState))]
            IOperationState operationState,

            [Import(typeof(SVsServiceProvider))]
            IServiceProvider serviceProvider
        )
        {
            TestContainersUpdated?.ToString();

            Logger.Clear();
            Logger.Initialize(serviceProvider, Vsix.Name);

            CoverageUtil.InstallOrUpdateCoverlet(exception =>
            {
                if (exception != null)
                {
                    Logger.Log(exception);
                    return;
                }

                operationState.StateChanged += OperationState_StateChanged;
                Logger.Log("Initialized!");
            });
        }
        private IEnumerable <ITagSpan <GlyphTag> > GetTags(ITextBuffer textBuffer, NormalizedSnapshotSpanCollection spans)
        {
            var document = (ITextDocument)textBuffer.Properties.GetProperty(typeof(ITextDocument));

            if (document != null)
            {
                foreach (var span in spans)
                {
                    var lineNumber = span.Start.GetContainingLine().LineNumber + 1;

                    var coverageLine = CoverageUtil.GetCoverageLine(document.FilePath, lineNumber);

                    if (coverageLine == null)
                    {
                        continue;
                    }

                    yield return(new TagSpan <GlyphTag>(span, new GlyphTag(coverageLine.HitCount > 0)));
                }
            }
        }