Fix scenario where lightbulbs weren't being displayed#74277
Merged
arunchndr merged 1 commit intodotnet:release/dev17.11from Jul 8, 2024
Merged
Conversation
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.
This was referenced Jul 5, 2024
CyrusNajmabadi
approved these changes
Jul 5, 2024
Contributor
Author
|
Looks like this also fixed https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1994182/?view=edit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.