Skip to content

Commit

Permalink
Merge pull request #73358 from CyrusNajmabadi/simplifyScope
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrusNajmabadi authored May 7, 2024
2 parents 409adb8 + a65103a commit 6f1513d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,11 @@ internal abstract class AbstractSuppressionBatchFixAllProvider : FixAllProvider
source,
produceItems: static async (tuple, callback, args, cancellationToken) =>
{
using var _ = args.progressTracker.ItemCompletedScope();

var (document, diagnosticsToFix) = tuple;
try
{
await args.@this.AddDocumentFixesAsync(
document, diagnosticsToFix, callback, args.fixAllState, cancellationToken).ConfigureAwait(false);
}
finally
{
args.progressTracker.ItemCompleted();
}
await args.@this.AddDocumentFixesAsync(
document, diagnosticsToFix, callback, args.fixAllState, cancellationToken).ConfigureAwait(false);
},
args: (@this: this, fixAllState, progressTracker),
cancellationToken).ConfigureAwait(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,8 @@ public static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic
source: projectsToFix,
produceItems: static async (projectToFix, callback, args, cancellationToken) =>
{
try
{
callback(await args.fixAllContext.GetAllDiagnosticsAsync(projectToFix).ConfigureAwait(false));
}
finally
{
args.progressTracker.ItemCompleted();
}
using var _ = args.progressTracker.ItemCompletedScope();
callback(await args.fixAllContext.GetAllDiagnosticsAsync(projectToFix).ConfigureAwait(false));
},
consumeItems: static async (results, args, cancellationToken) =>
{
Expand Down

0 comments on commit 6f1513d

Please sign in to comment.