Skip to content
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

Redirect SDK analyzers to VS #74775

Closed
wants to merge 1 commit into from
Closed

Conversation

jjonescz
Copy link
Member

@jjonescz jjonescz commented Aug 15, 2024

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Analyzers untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 15, 2024
/// Analyzers loaded from SDK are redirected to these VS-inserted analyzers
/// by <see cref="RedirectingAnalyzerAssemblyResolver"/>.
/// </summary>
internal sealed class InsertedAnalyzerProvider
Copy link
Member Author

Choose a reason for hiding this comment

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

This is for the most part a copy of VisualStudioDiagnosticAnalyzerProvider which does something similar - discovers analyzers from VSIXes.

@@ -77,6 +80,8 @@ public async Task<ProjectSystemProject> CreateAndAddToWorkspaceAsync(

var vsixAnalyzerProvider = await _vsixAnalyzerProviderFactory.GetOrCreateProviderAsync(cancellationToken).ConfigureAwait(false);

_visualStudioWorkspaceImpl.LazyInsertedAnalyzerProvider = await _insertedAnalyzerProviderFactory.GetOrCreateProviderAsync(cancellationToken).ConfigureAwait(false);
Copy link
Member Author

Choose a reason for hiding this comment

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

I wasn't sure where to put this "discovery of VSIX analyzers" (I'm not very familiar with the IDE part of the codebase) - I need that to be done before the RedirectingAnalyzerAssemblyResolver is called. I chose this place because it's where the similar IVisualStudioDiagnosticAnalyzerProviderFactory is called.

return null;
}

private ImmutableArray<Matcher> CreateMatchers()
Copy link
Member Author

Choose a reason for hiding this comment

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

This could be improved (e.g., by creating regexes), but I'm not sure the spec is final yet.

@jjonescz jjonescz closed this Aug 20, 2024
@jjonescz jjonescz deleted the tearing-redirect branch August 20, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Analyzers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant