Remove need for two attributes on diagnostic analyzers.
Current design of DiagnosticAnalyzers require each analyzer type to have 2 attributes: 1) DiagnosticAnalyzerAttribute: This is defined in Microsoft.CodeAnalysis and is used by (a) Command line compilers to detect analyzer types in analyzer assemblies. (b) MSBuild and IDE to detect per-project analyzers specified in the project file. 2) ExportDiagnosticAnalyzerAttribute: This is a MEF Export attribute used by the IDE to detect analyzers installed by VSIX extensions and to be used across the entire VS session. Having two attributes for the same purpose, but for different hosts is redundant. This change includes the following: 1) Change the VSIX based analyzer model to use the VSIX manifest file to specify the analyzer assemblies. The manifest file can specify an "Asset" tag with Type "Microsoft.VisualStudio.Analyzer" to explicitly specify an analyzer asset. IDE will treat these assemblies as analyzer file references for the workspace session and detect analyzers using the compiler layer DiagnosticAnalyzerAttribute. 2) Change DiagnosticAnalyzerAttribute constructor to take a params array of supported languages. Language specific diagnostic analyzers can specify explicit set of supported languages, and all the analyzer hosts will skip loading analyzers for unsupported languages (changeset 1322657)
Showing
想要评论请 注册 或 登录