Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix analyzer RCS0005 #1533

Merged
merged 2 commits into from
Sep 21, 2024
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 @@ -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
}
}");
}
}