-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Remove nested types in diagnostic analyzer service #77124
Remove nested types in diagnostic analyzer service #77124
Conversation
@@ -31,12 +31,10 @@ internal interface IDiagnosticAnalyzerService | |||
/// <summary> | |||
/// Get diagnostics of the given diagnostic ids and/or analyzers from the given solution. all diagnostics returned |
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.
@ToddGrun thia is ready for review. |
bool includeLocalDocumentDiagnostics, | ||
bool includeNonLocalDocumentDiagnostics) |
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.
general idea is that instead of making tehse nested types, which have to grab all this data, just to store fields, just to use in methods within the type, we just use local functions.
@@ -22,7 +22,7 @@ private partial class DiagnosticIncrementalAnalyzer | |||
/// <summary> | |||
/// Cached data from a real <see cref="Project"/> instance to the cached diagnostic data produced by | |||
/// <em>all</em> the analyzers for the project. This data can then be used by <see | |||
/// cref="DiagnosticGetter.ProduceDiagnosticsAsync"/> to speed up subsequent calls through the normal <see | |||
/// cref="GetDiagnosticsForIdsAsync"/> to speed up subsequent calls through the normal <see |
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.
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.
Will do!
...erver/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_GetDiagnostics.cs
Show resolved
Hide resolved
public async Task GetAsync(ArrayBuilder<DiagnosticData> list, CancellationToken cancellationToken) | ||
return list.ToImmutableAndClear(); | ||
|
||
async Task GetAsync(ArrayBuilder<DiagnosticData> list) |
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.
FYI, I really like this change. These *Getter classes for some reason added a lot of conceptual weight to this area for me. |
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.
Followup to #77122