public virtual IEnumerable <RazorDiagnostic> GetAllDiagnostics() { if (_allDiagnostics == null) { var attributeDiagnostics = Attributes.SelectMany(attribute => attribute.Diagnostics); var combinedDiagnostics = Diagnostics.Concat(attributeDiagnostics); _allDiagnostics = combinedDiagnostics.ToArray(); } return(_allDiagnostics); }
public DiagnosticReport Emit(string outputPath) { if (Diagnostics.HasErrors) { return(Diagnostics); } var emitter = new Emiter(program); emitter.Emit(); emitter.WriteTo(outputPath); return(new DiagnosticReport(Diagnostics.Concat(emitter.GetDiagnostics()))); }