public Diagnostic[] FromCode() { var analyzers = GetCSharpDiagnosticAnalyzers(); var diagnostics = analyzers .SelectMany( analyzer => DiagnosticVerifier.GetSortedDiagnostics(new[] { _source }, analyzer), (analyzer, diagnostic) => new { analyzers, diagnostic }); return(diagnostics.Select(d => d.diagnostic).ToArray()); }