-
-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Respect diagnostic RCS0062 for RCS1016 and RR0169
- Loading branch information
Showing
5 changed files
with
201 additions
and
61 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
src/Common/CSharp/Analysis/ConvertExpressionBodyAnalysis.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Microsoft.CodeAnalysis.CSharp; | ||
|
||
namespace Roslynator.CSharp.Analysis; | ||
|
||
internal static class ConvertExpressionBodyAnalysis | ||
{ | ||
public static bool AllowPutExpressionBodyOnItsOwnLine(SyntaxKind syntaxKind) | ||
{ | ||
// allow putting expression on new line for all method-like declarations, except for accessors. | ||
switch (syntaxKind) | ||
{ | ||
case SyntaxKind.MethodDeclaration: | ||
case SyntaxKind.ConstructorDeclaration: | ||
case SyntaxKind.DestructorDeclaration: | ||
case SyntaxKind.PropertyDeclaration: | ||
case SyntaxKind.IndexerDeclaration: | ||
case SyntaxKind.OperatorDeclaration: | ||
case SyntaxKind.ConversionOperatorDeclaration: | ||
return true; | ||
default: | ||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.