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) {