Skip to content

Commit 1f72cb7

Browse files
committed
Minor style clean-up and added missing link
1 parent 23a9178 commit 1f72cb7

3 files changed

Lines changed: 26 additions & 25 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/Helpers/RenameHelper.cs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -144,30 +144,30 @@ public static SyntaxNode GetParentDeclaration(SyntaxToken token)
144144
{
145145
switch (parent.Kind())
146146
{
147-
case SyntaxKind.VariableDeclarator:
148-
case SyntaxKind.Parameter:
149-
case SyntaxKind.TypeParameter:
150-
case SyntaxKind.CatchDeclaration:
151-
case SyntaxKind.ExternAliasDirective:
152-
case SyntaxKind.QueryContinuation:
153-
case SyntaxKind.FromClause:
154-
case SyntaxKind.LetClause:
155-
case SyntaxKind.JoinClause:
156-
case SyntaxKind.JoinIntoClause:
157-
case SyntaxKind.ForEachStatement:
158-
case SyntaxKind.UsingDirective:
159-
case SyntaxKind.LabeledStatement:
160-
case SyntaxKind.AnonymousObjectMemberDeclarator:
161-
return parent;
162-
163-
default:
164-
var declarationParent = parent as MemberDeclarationSyntax;
165-
if (declarationParent != null)
166-
{
167-
return declarationParent;
168-
}
169-
170-
break;
147+
case SyntaxKind.VariableDeclarator:
148+
case SyntaxKind.Parameter:
149+
case SyntaxKind.TypeParameter:
150+
case SyntaxKind.CatchDeclaration:
151+
case SyntaxKind.ExternAliasDirective:
152+
case SyntaxKind.QueryContinuation:
153+
case SyntaxKind.FromClause:
154+
case SyntaxKind.LetClause:
155+
case SyntaxKind.JoinClause:
156+
case SyntaxKind.JoinIntoClause:
157+
case SyntaxKind.ForEachStatement:
158+
case SyntaxKind.UsingDirective:
159+
case SyntaxKind.LabeledStatement:
160+
case SyntaxKind.AnonymousObjectMemberDeclarator:
161+
return parent;
162+
163+
default:
164+
var declarationParent = parent as MemberDeclarationSyntax;
165+
if (declarationParent != null)
166+
{
167+
return declarationParent;
168+
}
169+
170+
break;
171171
}
172172

173173
parent = parent.Parent;

StyleCop.Analyzers/StyleCop.Analyzers.Test/NamingRules/SA1314UnitTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,4 +271,4 @@ protected override CodeFixProvider GetCSharpCodeFixProvider()
271271
return new SA1314CodeFixProvider();
272272
}
273273
}
274-
}
274+
}

documentation/NamingRules.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ Identifier | Name | Description
1717
[SA1311](SA1311.md) | StaticReadonlyFieldsMustBeginWithUpperCaseLetter | The name of a static readonly field does not begin with an upper-case letter.
1818
[SA1312](SA1312.md) | VariableNamesMustBeginWithLowerCaseLetter | The name of a variable in C# does not begin with a lower-case letter.
1919
[SA1313](SA1313.md) | ParameterNamesMustBeginWithLowerCaseLetter | The name of a parameter in C# does not begin with a lower-case letter.
20+
[SA1314](SA1314.md) | TypeParameterNamesMustBeginWithT | The name of a C# type parameter does not begin with the capital letter T

0 commit comments

Comments
 (0)