From 8e101332dd12a3f623bf6fcaee9749089f33c93b Mon Sep 17 00:00:00 2001 From: David Barbet Date: Fri, 2 Jul 2021 13:22:57 -0700 Subject: [PATCH] feedback --- .../Handler/Diagnostics/AbstractPullDiagnosticHandler.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Features/LanguageServer/Protocol/Handler/Diagnostics/AbstractPullDiagnosticHandler.cs b/src/Features/LanguageServer/Protocol/Handler/Diagnostics/AbstractPullDiagnosticHandler.cs index 12bace2970004..40fdb82553285 100644 --- a/src/Features/LanguageServer/Protocol/Handler/Diagnostics/AbstractPullDiagnosticHandler.cs +++ b/src/Features/LanguageServer/Protocol/Handler/Diagnostics/AbstractPullDiagnosticHandler.cs @@ -149,7 +149,7 @@ private void OnDiagnosticsUpdated(object? sender, DiagnosticsUpdatedArgs updateA continue; } - if (HaveDiagnosticsChangedAndUpdateCache(documentToPreviousDiagnosticParams, document, out var newResultId)) + if (HaveDiagnosticsChanged(documentToPreviousDiagnosticParams, document, out var newResultId)) { context.TraceInformation($"Diagnostics were changed for document: {document.FilePath}"); progress.Report(await ComputeAndReportCurrentDiagnosticsAsync(context, document, newResultId, cancellationToken).ConfigureAwait(false)); @@ -267,12 +267,12 @@ private void HandleRemovedDocuments(RequestContext context, DiagnosticParams[] p /// the resultIds the client sent us. /// the document we are currently calculating results for. /// the resultId to report new diagnostics with if changed. - private bool HaveDiagnosticsChangedAndUpdateCache( + private bool HaveDiagnosticsChanged( Dictionary documentToPreviousDiagnosticParams, Document document, [NotNullWhen(true)] out string? newResultId) { - // Read and write the cached resultId to _documentIdToLastResultId in a single 'transaction' + // Read and write the cached resultId to _documentIdToLastResultId in a single transaction // to prevent in-between updates to _documentIdToLastResultId triggered by OnDiagnosticsUpdated. lock (_gate) {