Skip to content

Conversation

@mavasani
Copy link
Contributor

Fixes AB#1618061

This was introduced by me with #63130. Earlier we used to cache full document diagnostics computed only from background analysis, which also handles updating the error list simulataneously. With the above PR, we also do this caching from other code paths if we are computing full document diagnostics (diagnostic tagger, LSP pull diags, etc.), but we don't raise events to update the error list from these code paths - basically the code added here: https://github.com/mavasani/roslyn/blob/cd5e6895d3dc8dfad270505b37d28be70077a645/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs#L323-L329. So when background analysis gets to refreshing the document diagnostics, it founds cached items and ends up not updating the error list.

With this PR, we now cache the computed full document diagnostics in the new code paths only in LSP pull diagnostics mode. Verified that the repro in the above bug is fixed after this change.

Fixes [AB#1618061](https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1618061)

This was introduced by me with dotnet#63130. Earlier we used to cache full document diagnostics computed only from background analysis, which also handles updating the error list simulataneously. With the above PR, we also do this caching from other code paths if we are computing full document diagnostics (diagnostic tagger, LSP pull diags, etc.), but we don't raise events to update the error list from these code paths - basically the code added here: https://github.com/mavasani/roslyn/blob/cd5e6895d3dc8dfad270505b37d28be70077a645/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs#L323-L329. So when background analysis gets to refreshing the document diagnostics, it founds cached items and ends up not updating the error list.

With this PR, we now cache the computed full document diagnostics in the new code paths only in LSP pull diagnostics mode. Verified that the repro in the above bug is fixed after this change.
@mavasani mavasani requested a review from a team as a code owner September 21, 2022 12:01
@mavasani mavasani merged commit 9d380ab into dotnet:main Sep 21, 2022
@mavasani mavasani deleted the FixErrorListRegression branch September 21, 2022 17:35
@ghost ghost added this to the Next milestone Sep 21, 2022
@Cosifne Cosifne modified the milestones: Next, 17.4 P3 Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants