Skip to content

Commit 32f3a7c

Browse files
committed
Make SyntaxKindEx a static class with SyntaxKind constants
1 parent 640bb9b commit 32f3a7c

4 files changed

Lines changed: 22 additions & 41 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.Test/Lightup/DiscardDesignationSyntaxWrapperTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public void TestNull()
1818
var discardDesignationSyntax = (DiscardDesignationSyntaxWrapper)syntaxNode;
1919
Assert.Null(discardDesignationSyntax.SyntaxNode);
2020
Assert.Throws<NullReferenceException>(() => discardDesignationSyntax.UnderscoreToken);
21-
Assert.Throws<NullReferenceException>(() => discardDesignationSyntax.WithUnderscoreToken(SyntaxFactory.Token((SyntaxKind)SyntaxKindEx.UnderscoreToken)));
21+
Assert.Throws<NullReferenceException>(() => discardDesignationSyntax.WithUnderscoreToken(SyntaxFactory.Token(SyntaxKindEx.UnderscoreToken)));
2222
}
2323

2424
[Fact]

StyleCop.Analyzers/StyleCop.Analyzers/Helpers/NodeHelper.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

StyleCop.Analyzers/StyleCop.Analyzers/Lightup/SyntaxKindEx.cs

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,27 @@
55

66
namespace StyleCop.Analyzers.Lightup
77
{
8-
internal enum SyntaxKindEx
8+
using Microsoft.CodeAnalysis.CSharp;
9+
10+
internal static class SyntaxKindEx
911
{
10-
UnderscoreToken = 8491,
11-
IsPatternExpression = 8657,
12-
LocalFunctionStatement = 8830,
13-
TupleType = 8924,
14-
TupleElement = 8925,
15-
TupleExpression = 8926,
16-
SingleVariableDesignation = 8927,
17-
ParenthesizedVariableDesignation = 8928,
18-
ForEachVariableStatement = 8929,
19-
DeclarationPattern = 9000,
20-
ConstantPattern = 9002,
21-
CasePatternSwitchLabel = 9009,
22-
WhenClause = 9013,
23-
DiscardDesignation = 9014,
24-
DeclarationExpression = 9040,
25-
RefExpression = 9050,
26-
RefType = 9051,
27-
ThrowExpression = 9052,
12+
public const SyntaxKind UnderscoreToken = (SyntaxKind)8491;
13+
public const SyntaxKind IsPatternExpression = (SyntaxKind)8657;
14+
public const SyntaxKind LocalFunctionStatement = (SyntaxKind)8830;
15+
public const SyntaxKind TupleType = (SyntaxKind)8924;
16+
public const SyntaxKind TupleElement = (SyntaxKind)8925;
17+
public const SyntaxKind TupleExpression = (SyntaxKind)8926;
18+
public const SyntaxKind SingleVariableDesignation = (SyntaxKind)8927;
19+
public const SyntaxKind ParenthesizedVariableDesignation = (SyntaxKind)8928;
20+
public const SyntaxKind ForEachVariableStatement = (SyntaxKind)8929;
21+
public const SyntaxKind DeclarationPattern = (SyntaxKind)9000;
22+
public const SyntaxKind ConstantPattern = (SyntaxKind)9002;
23+
public const SyntaxKind CasePatternSwitchLabel = (SyntaxKind)9009;
24+
public const SyntaxKind WhenClause = (SyntaxKind)9013;
25+
public const SyntaxKind DiscardDesignation = (SyntaxKind)9014;
26+
public const SyntaxKind DeclarationExpression = (SyntaxKind)9040;
27+
public const SyntaxKind RefExpression = (SyntaxKind)9050;
28+
public const SyntaxKind RefType = (SyntaxKind)9051;
29+
public const SyntaxKind ThrowExpression = (SyntaxKind)9052;
2830
}
2931
}

StyleCop.Analyzers/StyleCop.Analyzers/StyleCop.Analyzers.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@
122122
<Compile Include="Helpers\ModifierOrderHelper.cs" />
123123
<Compile Include="Helpers\NamedTypeHelpers.cs" />
124124
<Compile Include="Helpers\NameSyntaxHelpers.cs" />
125-
<Compile Include="Helpers\NodeHelper.cs" />
126125
<Compile Include="Helpers\ObjectPools\ObjectPool`1.cs" />
127126
<Compile Include="Helpers\ObjectPools\PooledObject`1.cs" />
128127
<Compile Include="Helpers\ObjectPools\SharedPoolExtensions.cs" />

0 commit comments

Comments
 (0)