Skip to content

Commit 3196588

Browse files
committed
Did a bit of cleanup
1 parent c1e0d57 commit 3196588

1 file changed

Lines changed: 2 additions & 13 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers/ReadabilityRules/SA1106CodeFixProvider.cs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ namespace StyleCop.Analyzers.ReadabilityRules
2525
[Shared]
2626
internal class SA1106CodeFixProvider : CodeFixProvider
2727
{
28-
private static readonly ImmutableArray<string> FixableDiagnostics =
29-
ImmutableArray.Create(SA1106CodeMustNotContainEmptyStatements.DiagnosticId);
30-
3128
/// <inheritdoc/>
32-
public override ImmutableArray<string> FixableDiagnosticIds => FixableDiagnostics;
29+
public override ImmutableArray<string> FixableDiagnosticIds { get; } =
30+
ImmutableArray.Create(SA1106CodeMustNotContainEmptyStatements.DiagnosticId);
3331

3432
/// <inheritdoc/>
3533
public override FixAllProvider GetFixAllProvider()
@@ -42,11 +40,6 @@ public override Task RegisterCodeFixesAsync(CodeFixContext context)
4240
{
4341
foreach (var diagnostic in context.Diagnostics)
4442
{
45-
if (!diagnostic.Id.Equals(SA1106CodeMustNotContainEmptyStatements.DiagnosticId))
46-
{
47-
continue;
48-
}
49-
5043
context.RegisterCodeFix(
5144
CodeAction.Create(
5245
ReadabilityResources.SA1106CodeFix,
@@ -62,10 +55,6 @@ private static async Task<Document> GetTransformedDocumentAsync(Document documen
6255
{
6356
var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
6457
var token = root.FindToken(diagnostic.Location.SourceSpan.Start);
65-
if (token.IsMissingOrDefault())
66-
{
67-
return document;
68-
}
6958

7059
if (!token.Parent.IsKind(SyntaxKind.EmptyStatement))
7160
{

0 commit comments

Comments
 (0)