diff --git a/ChangeLog.md b/ChangeLog.md index bb697c7e16..520fc72151 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix formatting of argument list ([#952](https://github.com/josefpihrt/roslynator/pull/952). - Do not remove async/await when 'using declaration' is used ([#953](https://github.com/josefpihrt/roslynator/pull/953). - Convert if-else to return statement when pattern matching is used ([RCS1073](https://github.com/JosefPihrt/Roslynator/blob/main/docs/analyzers/RCS1073.md)) ([#956](https://github.com/josefpihrt/roslynator/pull/956). +- [CLI] Include compiler diagnostics in the xml output file of the `roslynator analyze` command ([#964](https://github.com/JosefPihrt/Roslynator/pull/964) by @PeterKaszab). - Do not simplify 'default' expression if the type is inferred ([RCS1244](https://github.com/JosefPihrt/Roslynator/blob/main/docs/analyzers/RCS1244.md)) ([#966](https://github.com/josefpihrt/roslynator/pull/966). - Use explicit type from lambda expression ([RCS1008](https://github.com/JosefPihrt/Roslynator/blob/main/docs/analyzers/RCS1008.md)) ([#967](https://github.com/josefpihrt/roslynator/pull/967). diff --git a/src/CommandLine/Xml/DiagnosticXmlSerializer.cs b/src/CommandLine/Xml/DiagnosticXmlSerializer.cs index 530e6922e9..19b9ca8a00 100644 --- a/src/CommandLine/Xml/DiagnosticXmlSerializer.cs +++ b/src/CommandLine/Xml/DiagnosticXmlSerializer.cs @@ -23,7 +23,7 @@ public static void Serialize( XElement summary = CreateSummary(results.SelectMany(f => f.CompilerDiagnostics.Concat(f.Diagnostics)), formatProvider); IEnumerable projectElements = results - .Where(f => f.Diagnostics.Any()) + .Where(f => f.Diagnostics.Any() || f.CompilerDiagnostics.Any()) .OrderBy(f => f.Project.FilePath, FileSystemHelpers.Comparer) .Select(result => SerializeProjectAnalysisResult(result, formatProvider)); @@ -41,6 +41,7 @@ private static XElement SerializeProjectAnalysisResult( new XElement( "Diagnostics", result.Diagnostics + .Concat(result.CompilerDiagnostics) .OrderBy(f => f.LineSpan.Path) .ThenBy(f => f.Descriptor.Id) .ThenBy(f => f.LineSpan.StartLinePosition.Line)