Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honor suppression on switch expression #57204

Merged
merged 1 commit into from
Oct 19, 2021
Merged

Conversation

jcouv
Copy link
Member

@jcouv jcouv commented Oct 18, 2021

Fixes #52143

@jcouv jcouv self-assigned this Oct 18, 2021
@jcouv jcouv marked this pull request as ready for review October 18, 2021 19:41
@jcouv jcouv requested a review from a team as a code owner October 18, 2021 19:41
@jcouv
Copy link
Member Author

jcouv commented Oct 19, 2021

@RikkiGibson @cston @dotnet/roslyn-compiler Please review this PR for a tiny fix. Thanks

@jcouv jcouv merged commit 4a00aa4 into dotnet:main Oct 19, 2021
@ghost ghost added this to the Next milestone Oct 19, 2021
@jcouv jcouv modified the milestones: Next, 17.1.P1 Oct 19, 2021
@jcouv jcouv deleted the switch-suppression2 branch October 19, 2021 18:57
RikkiGibson added a commit that referenced this pull request Oct 19, 2021
* Addresses the first bullet point in #56843.

Prior to this change, compiler diagnostic analyzer could only be run from the IDE for entire document span. This is primarily due to lack of an analyzer API that allows the analyzer to register a span-based semantic diagnostic callback. Though we can consider designing and adding such an analyzer API, it would be purely an IDE-only analyzer action, as analyzers are never executed for a span in batch compilation mode - this would make it difficult to justify adding such an API.

With this PR, we add a workaround in the analyzer driver to allow executing compiler analyzer's semantic model action scoped to a filter span. This should speed up executing the compiler analyzer for lightbulb scenarios in the IDE, which are always scoped to current line span.

Verified that both the compiler and IDE tests added with this PR fail prior to the product changes.

**NOTE:** This change would not give us any perceivable improvement in non-async lightbulb scenario, as we are extremely likely to have at least one other analyzer that needs to run on the entire document. The performance improvement should be perceivable in async lightbulb scenario as the high priority code fixes bucket (add usings and merge conflict resolution) only run the compiler analyzer.

* Update src/Compilers/Core/Portable/DiagnosticAnalyzer/DiagnosticAnalysisContext.cs

* Add test and fix filtering by analysis scope.

* Address further feedback

* Add work item attribute to test

* Remove GetAdjustedSpanForCompilerAnalyzerAsync workaround in the IDE

* Unncessary usings

* Revert "Unncessary usings"

This reverts commit 510edb8.

* Revert "Remove GetAdjustedSpanForCompilerAnalyzerAsync workaround in the IDE"

This reverts commit 23e3310.

* Update test to account for workaround in IDE DocumentAnalysisExecutor for #1557

* Address PR feedback

* Fix VisualStudioActiveDocumentTracker to handle VSSELELEMID.SEID_WindowFrame

Fixes #57203. Issue description has more details

* Update src/Compilers/Core/Portable/DiagnosticAnalyzer/CompilationUnitCompletedEvent.cs

* Apply arcade-powered source-build patches (#55823)

* Don't include desktop artifacts that don't exist in source-build.
Source-build doesn't have these artifacts available, even when we eventually will build desktop TFMs, because Roslyn is one of the first builds in source-build.  Instead Roslyn is picking up reference packages that don't have the `lib` directory which is causing a build failure.  This disables the attempt to grab these desktop artifacts so source-build just skips them instead.

* Honor suppression on switch expression (#57204)

* Merge pull request #57227 from dotnet/dev/rigibson/update-feature-status-2

Update Language Feature Status.md

Co-authored-by: Manish Vasani <mavasani@microsoft.com>
Co-authored-by: Chris Rummel <crummel@microsoft.com>
Co-authored-by: Julien Couvreur <jcouv@users.noreply.github.com>
Co-authored-by: Rikki Gibson <rigibson@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants