Skip to content

Remove unnecessary language tracking in the diagnostic service#77100

Merged
CyrusNajmabadi merged 2 commits intodotnet:mainfrom
CyrusNajmabadi:diagLanguage
Feb 7, 2025
Merged

Remove unnecessary language tracking in the diagnostic service#77100
CyrusNajmabadi merged 2 commits intodotnet:mainfrom
CyrusNajmabadi:diagLanguage

Conversation

@CyrusNajmabadi
Copy link
Contributor

No description provided.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner February 7, 2025 01:24
@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels 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);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

…nosticIncrementalAnalyzer.StateManager.HostStates.cs
Hash.Combine(HasSdkCodeStyleAnalyzers.GetHashCode(), AnalyzerReferences.GetHashCode()));
}
private readonly record struct HostAnalyzerStateSetKey(
string Language, bool HasSdkCodeStyleAnalyzers, IReadOnlyList<AnalyzerReference> AnalyzerReferences);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i love records.

@CyrusNajmabadi CyrusNajmabadi merged commit eeb5c70 into dotnet:main Feb 7, 2025
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Feb 7, 2025
@CyrusNajmabadi CyrusNajmabadi deleted the diagLanguage branch February 7, 2025 15:40
@akhera99 akhera99 modified the milestones: Next, 17.14 P2 Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants