diff --git a/src/VisualStudio/Core/Def/Implementation/TaskList/ExternalErrorDiagnosticUpdateSource.cs b/src/VisualStudio/Core/Def/Implementation/TaskList/ExternalErrorDiagnosticUpdateSource.cs index 49ce6dc8612814616bd2e9b1c011c59df433910e..dd73b5223a3c4f3ee970bd3bac7c29a96c7cb11f 100644 --- a/src/VisualStudio/Core/Def/Implementation/TaskList/ExternalErrorDiagnosticUpdateSource.cs +++ b/src/VisualStudio/Core/Def/Implementation/TaskList/ExternalErrorDiagnosticUpdateSource.cs @@ -435,8 +435,8 @@ private async Task ReportPreviousProjectErrorsIfRequiredAsync(ProjectId projectI private async Task SetLiveErrorsForProjectAsync(ProjectId projectId, InProgressState state, CancellationToken cancellationToken) { - var diagnostics = state.GetLiveErrorsForProject(projectId, cancellationToken); - await SetLiveErrorsForProjectAsync(projectId, diagnostics).ConfigureAwait(false); + var diagnostics = state.GetLiveErrorsForProject(projectId); + await SetLiveErrorsForProjectAsync(projectId, diagnostics, cancellationToken).ConfigureAwait(false); state.MarkLiveErrorsReported(projectId); } @@ -702,7 +702,7 @@ IEnumerable GetProjectsWithErrors() } } - public ImmutableArray GetLiveErrorsForProject(ProjectId projectId, CancellationToken cancellationToken) + public ImmutableArray GetLiveErrorsForProject(ProjectId projectId) { var project = Solution.GetRequiredProject(projectId); @@ -711,7 +711,7 @@ public ImmutableArray GetLiveErrorsForProject(ProjectId projectI using var _ = ArrayBuilder.GetInstance(out var builder); foreach (var (diagnostic, _) in diagnostics) { - if (IsLive(project, diagnostic, cancellationToken)) + if (IsLive(project, diagnostic)) { builder.Add(diagnostic); } @@ -732,7 +732,7 @@ public void AddError(DocumentId key, DiagnosticData diagnostic) public void AddError(ProjectId key, DiagnosticData diagnostic) => AddError(_projectMap, key, diagnostic); - private bool IsLive(Project project, DiagnosticData diagnosticData, CancellationToken cancellationToken) + private bool IsLive(Project project, DiagnosticData diagnosticData) { // REVIEW: current design is that we special case compiler analyzer case and we accept only document level // diagnostic as live. otherwise, we let them be build errors. we changed compiler analyzer accordingly as well @@ -744,7 +744,7 @@ private bool IsLive(Project project, DiagnosticData diagnosticData, Cancellation return false; } - if (IsSupportedLiveDiagnosticId(project, diagnosticData.Id, cancellationToken)) + if (IsSupportedLiveDiagnosticId(project, diagnosticData.Id)) { return true; } @@ -804,8 +804,6 @@ ImmutableHashSet ComputeSupportedLiveDiagnosticIds() foreach (var analyzersPerReference in project.Solution.State.Analyzers.CreateDiagnosticAnalyzersPerReference(project)) { - cancellationToken.ThrowIfCancellationRequested(); - foreach (var analyzer in analyzersPerReference.Value) { var diagnosticIds = infoCache.GetNonCompilationEndDiagnosticDescriptors(analyzer).Select(d => d.Id);