Skip to content

Fix scenario where lightbulbs weren't being displayed#74277

Merged
arunchndr merged 1 commit intodotnet:release/dev17.11from
ToddGrun:dev/toddgrun/17-11.RemoveTryGetDiagnosticsForSpanAsync
Jul 8, 2024
Merged

Fix scenario where lightbulbs weren't being displayed#74277
arunchndr merged 1 commit intodotnet:release/dev17.11from
ToddGrun:dev/toddgrun/17-11.RemoveTryGetDiagnosticsForSpanAsync

Conversation

@ToddGrun
Copy link
Contributor

@ToddGrun ToddGrun commented Jul 5, 2024

Merge from c5e8624


Addresses https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2087100

The recent change to remove solution crawler has apparently caused some regressions in lightbulb functionality and performance. This PR attempts to address at least one functional issue introduced as part of that change.

Previously, during solution load, solution crawler would cause the analyzer state sets to update via IncrementalAnalyzerProcessor.LowPriorityProcessor.ProcessProjectAsync's call to DiagnosticIncrementalAnalyzer.AnalyzeProjectAsync. Similarly, document updates would update the analyzer states the crawler's idle processing.

Instead of trying to hook back in these calls, this PR instead changes the diagnostic analyzer service to no longer offer a TryGetDiagnosticsForSpanAsync, instead forcing users to use the GetDiagnosticsForSpanAsync instead. The only caller of TryGetDiagnosticsForSpanAsync was inside the CodeFixService, and it seems like that code should just go ahead and force correct results. Thus, there is no concept of a non-upToDate call into the diagnostic service.

I'm going to separately investigate an issue with the StateManager's statesets not getting updated. I'm unsure why the code doesn't update the statesets upon calculation, but the fact that we are now recreating this on every lightbulb request is at least partly responsible for the recent lightbulb perf regression.

Addresses https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2087100

The recent change to remove solution crawler has apparently caused some regressions in lightbulb functionality and performance. This PR attempts to address at least one functional issue introduced as part of that change.

Previously, during solution load, solution crawler would cause the analyzer state sets to update via IncrementalAnalyzerProcessor.LowPriorityProcessor.ProcessProjectAsync's call to DiagnosticIncrementalAnalyzer.AnalyzeProjectAsync. Similarly, document updates would update the analyzer states the crawler's idle processing.

Instead of trying to hook back in these calls, this PR instead changes the diagnostic analyzer service to no longer offer a TryGetDiagnosticsForSpanAsync, instead forcing users to use the GetDiagnosticsForSpanAsync instead. The only caller of TryGetDiagnosticsForSpanAsync was inside the CodeFixService, and it seems like that code should just go ahead and force correct results. Thus, there is no concept of a non-upToDate call into the diagnostic service.

I'm going to separately investigate an issue with the StateManager's statesets not getting updated. I'm unsure why the code doesn't update the statesets upon calculation, but the fact that we are now recreating this on every lightbulb request is at least partly responsible for the recent lightbulb perf regression.
@ToddGrun ToddGrun requested a review from a team as a code owner July 5, 2024 18:30
@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 5, 2024
@arunchndr arunchndr merged commit 9586b0e into dotnet:release/dev17.11 Jul 8, 2024
@ToddGrun
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants