Fix OperationBlockStart analyzer callbacks#41403
Merged
mavasani merged 1 commit intodotnet:masterfrom Feb 6, 2020
Merged
Conversation
Fixes dotnet#41402 When performing analyzer execution from IDE for open files using [CompilationWithAnalyzers.GetAnalyzerSemanticDiagnosticsAsync](http://sourceroslyn.io/#q=CompilationWithAnalyzers.GetAnalyzerSemanticDiagnosticsAsync) API, we were not properly reseting the analyzer state after executing operation actions. This caused any subsequent operation block registrations by the same analyzer to be skipped in the analysis callbacks. This issue does not affect command line analyzer execution as we always run the analyzers on the entire compilation, and hence do not perform any partial state tracking. Verified that the added unit test fails prior to the fix.
sharwell
approved these changes
Feb 6, 2020
Contributor
Author
|
@dotnet/roslyn-compiler for reviews. |
333fred
approved these changes
Feb 6, 2020
cston
approved these changes
Feb 6, 2020
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.
Fixes #41402
When performing analyzer execution from IDE for open files using CompilationWithAnalyzers.GetAnalyzerSemanticDiagnosticsAsync API, we were not properly reseting the analyzer state after executing operation actions. This caused any subsequent operation block registrations by the same analyzer to be skipped in the analysis callbacks. This issue does not affect command line analyzer execution as we always run the analyzers on the entire compilation, and hence do not perform any partial state tracking.
Verified that the added unit test fails prior to the fix.