Remove unnecessary language tracking in the diagnostic service#77100
Merged
CyrusNajmabadi merged 2 commits intodotnet:mainfrom Feb 7, 2025
Merged
Remove unnecessary language tracking in the diagnostic service#77100CyrusNajmabadi merged 2 commits intodotnet:mainfrom
CyrusNajmabadi merged 2 commits intodotnet:mainfrom
Conversation
CyrusNajmabadi
commented
Feb 7, 2025
| /// this will only return <see cref="StateSet"/>s that have same language as <paramref name="project"/>. | ||
| /// </summary> | ||
| public IEnumerable<StateSet> GetStateSets(Project project) | ||
| => GetStateSets(project.Id).Where(s => s.Language == project.Language); |
Contributor
Author
There was a problem hiding this comment.
this method was never used. Demonstrating that storing the language was pointless, because we never actually did this filtering.
That said, even if this method had been called, this would still be pointless. That's because we're looking up state-sets for a particular project. And a project already only has analyzers associated with it that can run for it.
CyrusNajmabadi
commented
Feb 7, 2025
...tocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.StateManager.HostStates.cs
Outdated
Show resolved
Hide resolved
…nosticIncrementalAnalyzer.StateManager.HostStates.cs
CyrusNajmabadi
commented
Feb 7, 2025
| Hash.Combine(HasSdkCodeStyleAnalyzers.GetHashCode(), AnalyzerReferences.GetHashCode())); | ||
| } | ||
| private readonly record struct HostAnalyzerStateSetKey( | ||
| string Language, bool HasSdkCodeStyleAnalyzers, IReadOnlyList<AnalyzerReference> AnalyzerReferences); |
Contributor
Author
There was a problem hiding this comment.
i love records.
dibarbet
approved these changes
Feb 7, 2025
JoeRobich
approved these changes
Feb 7, 2025
This was referenced Feb 8, 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.
No description provided.