-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Push diagnostic suppression filtering flag to feature levels #76849
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
Merged
CyrusNajmabadi
merged 12 commits into
dotnet:main
from
CyrusNajmabadi:suppressedDiagnosticsFlag
Jan 22, 2025
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
bf43020
Push diagnostic suppression filtering flag to feature levels
CyrusNajmabadi 728a8cc
Remove
CyrusNajmabadi 5a1c0b2
Remove
CyrusNajmabadi e5b1721
Fix
CyrusNajmabadi 25e37fb
Fix
CyrusNajmabadi 9a4da49
Merge branch 'deleteExtension' into suppressedDiagnosticsFlag
CyrusNajmabadi e296e09
Merge remote-tracking branch 'upstream/main' into suppressedDiagnosti…
CyrusNajmabadi 5984584
Remove unused usings
CyrusNajmabadi 30a0670
Simplify
CyrusNajmabadi e9fa4a6
Update doc
CyrusNajmabadi 68810d9
Merge remote-tracking branch 'upstream/main' into suppressedDiagnosti…
CyrusNajmabadi 3482093
move into loop
CyrusNajmabadi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,7 +69,7 @@ public async Task TestHasSuccessfullyLoadedBeingFalse() | |
|
|
||
| var diagnostics = await analyzer.GetDiagnosticsForIdsAsync( | ||
| workspace.CurrentSolution, projectId: null, documentId: null, diagnosticIds: null, shouldIncludeAnalyzer: null, getDocuments: null, | ||
| includeSuppressedDiagnostics: false, includeLocalDocumentDiagnostics: true, includeNonLocalDocumentDiagnostics: false, CancellationToken.None); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: code that passes includeSuppressedDiagnostics: false needs to filter the results. I do that for features. HOwever, for tests, it doesn't seem to have any impact on results. so for simplicity i'm not doing it. |
||
| includeLocalDocumentDiagnostics: true, includeNonLocalDocumentDiagnostics: false, CancellationToken.None); | ||
| Assert.NotEmpty(diagnostics); | ||
| } | ||
|
|
||
|
|
@@ -705,7 +705,7 @@ internal async Task TestOnlyRequiredAnalyzerExecutedDuringDiagnosticComputation( | |
| var diagnosticsMapResults = await DiagnosticComputer.GetDiagnosticsAsync( | ||
| document, project, Checksum.Null, span: null, projectAnalyzerIds: [], analyzerIdsToRequestDiagnostics, | ||
| AnalysisKind.Semantic, new DiagnosticAnalyzerInfoCache(), workspace.Services, | ||
| isExplicit: false, reportSuppressedDiagnostics: false, logPerformanceInfo: false, getTelemetryInfo: false, | ||
| isExplicit: false, logPerformanceInfo: false, getTelemetryInfo: false, | ||
| cancellationToken: CancellationToken.None); | ||
| Assert.False(analyzer2.ReceivedSymbolCallback); | ||
|
|
||
|
|
@@ -773,7 +773,7 @@ async Task VerifyCallbackSpanAsync(TextSpan? filterSpan) | |
| _ = await DiagnosticComputer.GetDiagnosticsAsync( | ||
| documentToAnalyze, project, Checksum.Null, filterSpan, analyzerIdsToRequestDiagnostics, hostAnalyzerIds: [], | ||
| analysisKind, new DiagnosticAnalyzerInfoCache(), workspace.Services, | ||
| isExplicit: false, reportSuppressedDiagnostics: false, logPerformanceInfo: false, getTelemetryInfo: false, | ||
| isExplicit: false, logPerformanceInfo: false, getTelemetryInfo: false, | ||
| CancellationToken.None); | ||
| Assert.Equal(filterSpan, analyzer.CallbackFilterSpan); | ||
| if (kind == FilterSpanTestAnalyzer.AnalysisKind.AdditionalFile) | ||
|
|
@@ -827,7 +827,7 @@ void M() | |
| try | ||
| { | ||
| _ = await DiagnosticComputer.GetDiagnosticsAsync(document, project, Checksum.Null, span: null, | ||
| projectAnalyzerIds: [], analyzerIds, kind, diagnosticAnalyzerInfoCache, workspace.Services, isExplicit: false, reportSuppressedDiagnostics: false, | ||
| projectAnalyzerIds: [], analyzerIds, kind, diagnosticAnalyzerInfoCache, workspace.Services, isExplicit: false, | ||
| logPerformanceInfo: false, getTelemetryInfo: false, cancellationToken: analyzer.CancellationToken); | ||
|
|
||
| throw ExceptionUtilities.Unreachable(); | ||
|
|
@@ -840,7 +840,7 @@ void M() | |
|
|
||
| // Then invoke analysis without cancellation token, and verify non-cancelled diagnostic. | ||
| var diagnosticsMap = await DiagnosticComputer.GetDiagnosticsAsync(document, project, Checksum.Null, span: null, | ||
| projectAnalyzerIds: [], analyzerIds, kind, diagnosticAnalyzerInfoCache, workspace.Services, isExplicit: false, reportSuppressedDiagnostics: false, | ||
| projectAnalyzerIds: [], analyzerIds, kind, diagnosticAnalyzerInfoCache, workspace.Services, isExplicit: false, | ||
| logPerformanceInfo: false, getTelemetryInfo: false, cancellationToken: CancellationToken.None); | ||
| var builder = diagnosticsMap.Diagnostics.Single().diagnosticMap; | ||
| var diagnostic = kind == AnalysisKind.Syntax ? builder.Syntax.Single().Item2.Single() : builder.Semantic.Single().Item2.Single(); | ||
|
|
||
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: if a featuree passes
includeSuppressedDiagnostics: true, it needs no change. We always return all diagnostics by default, including suppressed ones.