Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix analyzer [RCS1043](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1043) ([PR](https://github.com/dotnet/roslynator/pull/1684))
- Fix analyzer [RCS1213](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1213) ([PR](https://github.com/dotnet/roslynator/pull/1686))
- Add unity method `OnRectTransformDimensionsChange`
- Fix analyzer [RCS1253](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1253) ([PR](https://github.com/dotnet/roslynator/pull/1687))
- Fix refactoring [Check expression for null](https://josefpihrt.github.io/docs/roslynator/refactorings/RR0024) ([PR](https://github.com/dotnet/roslynator/pull/1682))

## [4.14.0] - 2025-07-26
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ private static void AnalyzeSingleLineDocumentationCommentTrivia(SyntaxNodeAnalys
if (endTag?.IsMissing == false
&& startTag.GetSpanEndLine() < endTag.GetSpanStartLine())
{
foreach (XmlNodeSyntax node in summaryElement.Content)
{
if (node is XmlElementSyntax xmlElement)
{
switch (xmlElement.GetTag())
{
case XmlTag.Code:
case XmlTag.List:
case XmlTag.Para:
return;
}
}
}

Match match = SingleLineSummaryRegex.Match(
summaryElement.ToString(),
startTag.Span.End - summaryElement.SpanStart,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ public async Task Test_ToSingleLine()
{
await VerifyDiagnosticAndFixAsync(@"
/// [|<summary>
/// a<code>b</code>c
/// a<c>b</c>c
/// </summary>|]
class C
{
}
", @"
/// <summary>a<code>b</code>c</summary>
/// <summary>a<c>b</c>c</summary>
class C
{
}
Expand Down Expand Up @@ -179,6 +179,19 @@ await VerifyNoDiagnosticAsync(@"
class C
{
}
", options: Options.AddConfigOption(ConfigOptionKeys.DocCommentSummaryStyle, ConfigOptionValues.DocCommentSummaryStyle_SingleLine));
}

[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatDocumentationCommentSummary)]
public async Task TestNoDiagnostic_ParaElement_ToSingleLine()
{
await VerifyNoDiagnosticAsync(@"
/// <summary>
/// <para>x</para>
/// </summary>
class C
{
}
", options: Options.AddConfigOption(ConfigOptionKeys.DocCommentSummaryStyle, ConfigOptionValues.DocCommentSummaryStyle_SingleLine));
}
}
Loading