diff --git a/src/Integration.Vsix/SonarLintTagger/IssueConsumer.cs b/src/Integration.Vsix/SonarLintTagger/IssueConsumer.cs index 35d902db0..f7e09675f 100644 --- a/src/Integration.Vsix/SonarLintTagger/IssueConsumer.cs +++ b/src/Integration.Vsix/SonarLintTagger/IssueConsumer.cs @@ -62,7 +62,6 @@ internal class IssueConsumer : IIssueConsumer private readonly ITextSnapshot analysisSnapshot; private readonly IAnalysisIssueVisualizationConverter issueToIssueVisualizationConverter; private readonly string analysisFilePath; - private List allIssues; private readonly OnIssuesChanged onIssuesChanged; public delegate void OnIssuesChanged(IEnumerable issues); @@ -73,8 +72,6 @@ public IssueConsumer(ITextSnapshot analysisSnapshot, string analysisFilePath, On this.analysisFilePath = analysisFilePath ?? throw new ArgumentNullException(nameof(analysisFilePath)); this.onIssuesChanged = onIssuesChangedCallback ?? throw new ArgumentNullException(nameof(onIssuesChangedCallback)); this.issueToIssueVisualizationConverter = issueToIssueVisualizationConverter ?? throw new ArgumentNullException(nameof(issueToIssueVisualizationConverter)); - - allIssues = new List(); } public void Set(string path, IEnumerable issues) @@ -88,12 +85,10 @@ public void Set(string path, IEnumerable issues) Debug.Assert(issues.All(IsIssueFileLevelOrInAnalysisSnapshot), "Not all reported issues could be mapped to the analysis snapshot"); - allIssues = issues + onIssuesChanged.Invoke(issues .Where(IsIssueFileLevelOrInAnalysisSnapshot) .Select(x => issueToIssueVisualizationConverter.Convert(x, analysisSnapshot)) - .ToList(); - - onIssuesChanged.Invoke(allIssues); + .ToList()); } ///