internal void ReportAnalyzerExceptionDiagnostic(DiagnosticAnalyzer analyzer, Diagnostic exceptionDiagnostic, Compilation compilation)
        {
            Contract.ThrowIfFalse(AnalyzerManager.IsAnalyzerExceptionDiagnostic(exceptionDiagnostic));

            if (_hostDiagnosticUpdateSource == null)
            {
                return;
            }

            if (compilation != null)
            {
                var effectiveDiagnostic = CompilationWithAnalyzers.GetEffectiveDiagnostics(ImmutableArray.Create(exceptionDiagnostic), compilation).SingleOrDefault();
                if (effectiveDiagnostic == null)
                {
                    return;
                }
                else
                {
                    exceptionDiagnostic = effectiveDiagnostic;
                }
            }

            _hostDiagnosticUpdateSource.ReportAnalyzerDiagnostic(analyzer, exceptionDiagnostic, this.Project.Solution.Workspace, this.Project);
        }