Make more APIs project-based in diag service.#77122
Merged
CyrusNajmabadi merged 13 commits intodotnet:mainfrom Feb 10, 2025
Merged
Make more APIs project-based in diag service.#77122CyrusNajmabadi merged 13 commits intodotnet:mainfrom
CyrusNajmabadi merged 13 commits intodotnet:mainfrom
Conversation
CyrusNajmabadi
commented
Feb 10, 2025
|
|
||
| await analyzerService.GetDiagnosticsForIdsAsync( | ||
| sourceDocument.Project.Solution, sourceDocument.Project.Id, sourceDocument.Id, diagnosticIds: null, shouldIncludeAnalyzer: null, | ||
| sourceDocument.Project, sourceDocument.Id, diagnosticIds: null, shouldIncludeAnalyzer: null, |
Contributor
Author
There was a problem hiding this comment.
most callers had a project, but would then use it to pass a Solution+ProjectId. Simpler to just pass Project
CyrusNajmabadi
commented
Feb 10, 2025
| return list.ToImmutableAndClear(); | ||
| } | ||
|
|
||
| private static async Task<ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>>> ComputeDocumentDiagnosticsCoreAsync( |
Contributor
Author
There was a problem hiding this comment.
these are moves of a couple of static methods to an outer scope so they can be seen by a few nested types.
Contributor
Author
ToddGrun
reviewed
Feb 10, 2025
| var exceptionFilter = (Exception ex) => | ||
| { | ||
| return ex => | ||
| if (ex is not OperationCanceledException && crashOnAnalyzerException) |
Contributor
ToddGrun
reviewed
Feb 10, 2025
| else | ||
| { | ||
| var analyzerWithStateAndEmptyData = analyzer; | ||
| if (!compilerAnalyzerData.HasValue && analyzer.IsCompilerAnalyzer()) |
Contributor
There was a problem hiding this comment.
if (!compilerAnalyzerData.HasValue && analyzer.IsCompilerAnalyzer())
Could the loop contents just be:
var spanBased = (oldDocumentVersion == VersionStamp.Default);
if (!compilerAnalyzerData.HasValue && analyzer.IsCompilerAnalyzer())
compilerAnalyzerData = (analyzer, spanBased);
else if (spanBased)
spanBasedAnalyzers.Add(analyzer);
else
documentBasedAnalyzers.Add(analyzer);
dibarbet
approved these changes
Feb 10, 2025
This was referenced Feb 12, 2025
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.
Followup to #77121
Also address feedback from #77121