Skip to content

Commit 6d769b1

Browse files
committed
Fix CancellationToken handling in SA1129 Fix All provider
1 parent 88fd95e commit 6d769b1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/ReadabilityRules/SA1129CodeFixProvider.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private static bool IsType<T>(TypeSyntax typeSyntax, SemanticModel semanticModel
9797
{
9898
return false;
9999
}
100-
100+
101101
return true;
102102
}
103103

@@ -131,11 +131,11 @@ protected override async Task<SyntaxNode> FixAllInDocumentAsync(FixAllContext fi
131131
}
132132

133133
var syntaxRoot = await document.GetSyntaxRootAsync(fixAllContext.CancellationToken).ConfigureAwait(false);
134-
var semanticModel = await document.GetSemanticModelAsync().ConfigureAwait(false);
134+
var semanticModel = await document.GetSemanticModelAsync(fixAllContext.CancellationToken).ConfigureAwait(false);
135135

136136
var nodes = diagnostics.Select(diagnostic => syntaxRoot.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true));
137137

138-
return syntaxRoot.ReplaceNodes(nodes, (originalNode, rewrittenNode) => GetReplacementNode(rewrittenNode, semanticModel, CancellationToken.None));
138+
return syntaxRoot.ReplaceNodes(nodes, (originalNode, rewrittenNode) => GetReplacementNode(rewrittenNode, semanticModel, fixAllContext.CancellationToken));
139139
}
140140
}
141141
}

0 commit comments

Comments
 (0)