From bfc9cd99693669de0d2225b5246ced4929b547b6 Mon Sep 17 00:00:00 2001 From: Manish Vasani Date: Wed, 23 Oct 2019 10:50:14 -0700 Subject: [PATCH] Only log information for code fixes that can fix the diagnostics. --- .../Implementation/CodeFixes/CodeFixService.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/EditorFeatures/Core/Implementation/CodeFixes/CodeFixService.cs b/src/EditorFeatures/Core/Implementation/CodeFixes/CodeFixService.cs index 5fb68e54727..fafb7217019 100644 --- a/src/EditorFeatures/Core/Implementation/CodeFixes/CodeFixService.cs +++ b/src/EditorFeatures/Core/Implementation/CodeFixes/CodeFixService.cs @@ -300,12 +300,12 @@ public async Task ApplyCodeFixesForSpecificDiagnosticIdAsync(Document { cancellationToken.ThrowIfCancellationRequested(); - using (RoslynEventSource.LogInformationalBlock(FunctionId.CodeFixes_GetCodeFixesAsync, fixer, cancellationToken)) - { - await AppendFixesOrConfigurationsAsync( - document, span, diagnostics, fixAllForInSpan, result, fixer, - hasFix: d => this.GetFixableDiagnosticIds(fixer, extensionManager).Contains(d.Id), - getFixes: dxs => + await AppendFixesOrConfigurationsAsync( + document, span, diagnostics, fixAllForInSpan, result, fixer, + hasFix: d => this.GetFixableDiagnosticIds(fixer, extensionManager).Contains(d.Id), + getFixes: dxs => + { + using (RoslynEventSource.LogInformationalBlock(FunctionId.CodeFixes_GetCodeFixesAsync, fixer, cancellationToken)) { if (fixAllForInSpan) { @@ -316,9 +316,9 @@ public async Task ApplyCodeFixesForSpecificDiagnosticIdAsync(Document { return GetCodeFixesAsync(document, span, fixer, isBlocking, dxs, cancellationToken); } - }, - cancellationToken: cancellationToken).ConfigureAwait(false); - } + } + }, + cancellationToken: cancellationToken).ConfigureAwait(false); // Just need the first result if we are doing fix all in span if (fixAllForInSpan && result.Any()) return; -- GitLab