Skip to content

Commit

Permalink
Fix analyzer RCS0005 (#1533)
Browse files Browse the repository at this point in the history
  • Loading branch information
josefpihrt authored Sep 21, 2024
1 parent e07914c commit 48d201b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix analyzer [RCS0053](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0053) ([PR](https://github.com/dotnet/roslynator/pull/1518))
- Fix analyzer [RCS0056](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0056) ([PR](https://github.com/dotnet/roslynator/pull/1521))
- Fix analyzer [RCS1181](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1181) ([PR](https://github.com/dotnet/roslynator/pull/1526))
- Fix analyzer [RCS0005](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0005) ([PR](https://github.com/dotnet/roslynator/pull/1533))

## [4.12.5] - 2024-09-13

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ static bool IsPrecededWithEmptyLineOrRegionDirective(EndRegionDirectiveTriviaSyn
return en.Current.IsKind(
SyntaxKind.EndOfLineTrivia,
SyntaxKind.RegionDirectiveTrivia,
SyntaxKind.EndRegionDirectiveTrivia);
SyntaxKind.EndRegionDirectiveTrivia,
SyntaxKind.PragmaWarningDirectiveTrivia);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,28 @@ await VerifyNoDiagnosticAsync(@"
#endregion
");
}

[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeEndRegionDirective)]
public async Task TestNoDiagnostic_PragmaWarningDirective()
{
await VerifyNoDiagnosticAsync(@"
namespace N
{
/// <summary>
/// x
/// </summary>
class C
{
#region R
#pragma warning disable 1591
public int P { get; set; }
#pragma warning restore 1591
#endregion
}
}");
}
}

0 comments on commit 48d201b

Please sign in to comment.