-
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
Redirect SDK analyzers to VS #74775
Redirect SDK analyzers to VS #74775
Conversation
/// Analyzers loaded from SDK are redirected to these VS-inserted analyzers | ||
/// by <see cref="RedirectingAnalyzerAssemblyResolver"/>. | ||
/// </summary> | ||
internal sealed class InsertedAnalyzerProvider |
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.
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); |
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.
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() |
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.
This could be improved (e.g., by creating regexes), but I'm not sure the spec is final yet.
Spec: https://github.com/jjonescz/dotnet-sdk/blob/tearing-redirect/documentation/general/analyzer-redirecting.md
Part of dotnet/sdk#42087.