-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Remove 'filters' from IDiagService and make it a pure data api. #80177
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
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9e30303
Do not expose in proc filters in diag service
CyrusNajmabadi 890672d
In progress
CyrusNajmabadi 561adde
In progress
CyrusNajmabadi 391e760
Downstream
CyrusNajmabadi d460c2f
Tests
CyrusNajmabadi 08c722b
Merge remote-tracking branch 'upstream/main' into diagnosticFilters
CyrusNajmabadi dcf28e9
Rename
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
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 |
---|---|---|
|
@@ -33,23 +33,6 @@ internal interface IDiagnosticAnalyzerService : IWorkspaceService | |
Task<ImmutableArray<DiagnosticData>> ForceRunCodeAnalysisDiagnosticsAsync( | ||
Project project, CancellationToken cancellationToken); | ||
|
||
/// <summary> | ||
/// The default analyzer filter that will be used in functions like <see cref="GetDiagnosticsForIdsAsync"/> if | ||
/// no filter is provided. The default filter has the following rules: | ||
/// <list type="number"> | ||
/// <item>The standard compiler analyzer will not be run if the compiler diagnostic scope is <see cref="CompilerDiagnosticsScope.None"/>.</item> | ||
/// <item>A regular analyzer will not be run if <see cref="ProjectState.RunAnalyzers"/> is false.</item> | ||
/// <item>A regular analyzer will not be run if if the background analysis scope is <see cref="BackgroundAnalysisScope.None"/>.</item> | ||
/// <item>If a set of diagnostic ids are provided, the analyzer will not be run unless it declares at least one | ||
/// descriptor in that set.</item> | ||
/// <item>Otherwise, the analyzer will be run</item> | ||
/// </list> | ||
/// </summary> | ||
/// <param name="additionalFilter">An additional filter that can accept or reject analyzers that the default | ||
/// rules have accepted.</param> | ||
Func<DiagnosticAnalyzer, bool> GetDefaultAnalyzerFilter( | ||
Project project, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? additionalFilter = null); | ||
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. filter callbacks removed from api, as ti requires processing by teh caller (which is on the VS side, not the OOP side). |
||
|
||
/// <inheritdoc cref="IRemoteDiagnosticAnalyzerService.GetDeprioritizationCandidatesAsync"/> | ||
Task<ImmutableArray<DiagnosticAnalyzer>> GetDeprioritizationCandidatesAsync( | ||
Project project, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken); | ||
|
@@ -65,10 +48,7 @@ Task<ImmutableArray<DiagnosticAnalyzer>> GetDeprioritizationCandidatesAsync( | |
/// <param name="documentIds">Optional documents to scope the returned diagnostics. If <see langword="default"/>, | ||
/// then diagnostics will be returned for <see cref="Project.DocumentIds"/> and <see cref="Project.AdditionalDocumentIds"/>.</param> | ||
/// <param name="diagnosticIds">Optional set of diagnostic IDs to scope the returned diagnostics.</param> | ||
/// <param name="shouldIncludeAnalyzer">Optional callback to filter out analyzers to execute for computing diagnostics. | ||
/// If not present, <see cref="GetDefaultAnalyzerFilter"/> will be used. If present, no default behavior | ||
/// is used, and the callback is defered to entirely. To augment the existing default rules call | ||
/// <see cref="GetDefaultAnalyzerFilter"/> explicitly, and pass the result of that into this method.</param> | ||
/// <param name="analyzerFilter">Which analyzers to run.</param> | ||
/// <param name="includeLocalDocumentDiagnostics"> | ||
/// Indicates if local document diagnostics must be returned. | ||
/// Local diagnostics are the ones that are reported by analyzers on the same file for which the callback was received | ||
|
@@ -80,7 +60,7 @@ Task<ImmutableArray<DiagnosticAnalyzer>> GetDeprioritizationCandidatesAsync( | |
/// project must be analyzed to get the complete set of non-local document diagnostics. | ||
/// </remarks> | ||
Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync( | ||
Project project, ImmutableArray<DocumentId> documentIds, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeLocalDocumentDiagnostics, CancellationToken cancellationToken); | ||
Project project, ImmutableArray<DocumentId> documentIds, ImmutableHashSet<string>? diagnosticIds, AnalyzerFilter analyzerFilter, bool includeLocalDocumentDiagnostics, CancellationToken cancellationToken); | ||
|
||
/// <summary> | ||
/// Get project diagnostics (diagnostics with no source location) of the given diagnostic ids and/or analyzers from | ||
|
@@ -90,12 +70,9 @@ Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync( | |
/// </summary> | ||
/// <param name="project">Project to fetch the diagnostics for.</param> | ||
/// <param name="diagnosticIds">Optional set of diagnostic IDs to scope the returned diagnostics.</param> | ||
/// <param name="shouldIncludeAnalyzer">Optional callback to filter out analyzers to execute for computing diagnostics. | ||
/// If not present, <see cref="GetDefaultAnalyzerFilter"/> will be used. If present, no default behavior | ||
/// is used, and the callback is defered to entirely. To augment the existing default rules call | ||
/// <see cref="GetDefaultAnalyzerFilter"/> explicitly, and pass the result of that into this method.</param> | ||
/// <param name="analyzerFilter">Which analyzers to run.</param> | ||
Task<ImmutableArray<DiagnosticData>> GetProjectDiagnosticsForIdsAsync( | ||
Project project, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, CancellationToken cancellationToken); | ||
Project project, ImmutableHashSet<string>? diagnosticIds, AnalyzerFilter analyzerFilter, CancellationToken cancellationToken); | ||
|
||
/// <summary> | ||
/// Return up to date diagnostics for the given span for the document | ||
|
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.
callback replaced with pure-data enum. 'null' means 'include everything'.
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.
filter appears to be required and never nullable, or did I miss something