From 9f123b6010511756da0cffb958197daa513e135a Mon Sep 17 00:00:00 2001 From: Josef Pihrt Date: Fri, 10 May 2024 16:17:59 +0200 Subject: [PATCH] Fix analyzer RCS0036 (#1466) --- ChangeLog.md | 1 + .../BlankLineBetweenDeclarationsAnalyzer.cs | 8 +++-- ...enSingleLineDeclarationsOfSameKindTests.cs | 30 +++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index c82e0c8b76..3e6188221a 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix analyzer [RCS1085](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1085) ([PR](https://github.com/dotnet/roslynator/pull/1461)) - Fix analyzer [RCS1077](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1077) ([PR](https://github.com/dotnet/roslynator/pull/1463)) - [CLI] Fix `roslynator analyze --include/--exclude` ([PR](https://github.com/dotnet/roslynator/pull/1459)) +- Fix analyzer [RCS0036](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0036) ([PR](https://github.com/dotnet/roslynator/pull/1466)) ## [4.12.2] - 2024-04-23 diff --git a/src/Formatting.Analyzers/CSharp/BlankLineBetweenDeclarationsAnalyzer.cs b/src/Formatting.Analyzers/CSharp/BlankLineBetweenDeclarationsAnalyzer.cs index 58fd68299a..843480381e 100644 --- a/src/Formatting.Analyzers/CSharp/BlankLineBetweenDeclarationsAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/BlankLineBetweenDeclarationsAnalyzer.cs @@ -118,8 +118,11 @@ private static void Analyze(SyntaxNodeAnalysisContext context, SyntaxList + /// + string P2 { get; set; } +} +"); + } + + [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind)] + public async Task TestNoDiagnostic_DocCommentBetweenEnumMembers() + { + await VerifyNoDiagnosticAsync(@" +enum C +{ + A, + + /// + /// + B, +} "); } }