diff --git a/eng/config/rulesets/NonShipping.ruleset b/eng/config/rulesets/NonShipping.ruleset index fbf3292e54b06bf1a872887928b4fd7e32261fb9..d2c0144fdadc31145467ab2140ef2d383e475676 100644 --- a/eng/config/rulesets/NonShipping.ruleset +++ b/eng/config/rulesets/NonShipping.ruleset @@ -32,6 +32,12 @@ + + + + + + diff --git a/src/Compilers/Core/Portable/DiagnosticAnalyzer/CompilerDiagnosticAnalyzer.cs b/src/Compilers/Core/Portable/DiagnosticAnalyzer/CompilerDiagnosticAnalyzer.cs index 292f303a89d585d15dcf5fac0522d5b21607b438..b5d2589126890d1d1bbc32e967272b08c41a314f 100644 --- a/src/Compilers/Core/Portable/DiagnosticAnalyzer/CompilerDiagnosticAnalyzer.cs +++ b/src/Compilers/Core/Portable/DiagnosticAnalyzer/CompilerDiagnosticAnalyzer.cs @@ -35,6 +35,9 @@ public sealed override ImmutableArray SupportedDiagnostics public sealed override void Initialize(AnalysisContext context) { + context.EnableConcurrentExecution(); + context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); + context.RegisterCompilationStartAction(c => { var analyzer = new CompilationAnalyzer(c.Compilation); diff --git a/src/EditorFeatures/Core/Implementation/RenameTracking/RenameTrackingDiagnosticAnalyzer.cs b/src/EditorFeatures/Core/Implementation/RenameTracking/RenameTrackingDiagnosticAnalyzer.cs index ff2d72475c83604355701edea71636a88b5d17a0..0ac285422b48f08369688c79e1a6f44cdd32f5f9 100644 --- a/src/EditorFeatures/Core/Implementation/RenameTracking/RenameTrackingDiagnosticAnalyzer.cs +++ b/src/EditorFeatures/Core/Implementation/RenameTracking/RenameTrackingDiagnosticAnalyzer.cs @@ -26,8 +26,14 @@ public DiagnosticAnalyzerCategory GetAnalyzerCategory() public bool OpenFileOnly(Workspace workspace) => true; +#pragma warning disable RS1026 // Enable concurrent execution public override void Initialize(AnalysisContext context) - => context.RegisterSyntaxTreeAction(AnalyzeSyntaxTree); +#pragma warning restore RS1026 // Enable concurrent execution + { + context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); + + context.RegisterSyntaxTreeAction(AnalyzeSyntaxTree); + } private void AnalyzeSyntaxTree(SyntaxTreeAnalysisContext context) { diff --git a/src/Features/Core/Portable/Diagnostics/Analyzers/DocumentDiagnosticAnalyzer.cs b/src/Features/Core/Portable/Diagnostics/Analyzers/DocumentDiagnosticAnalyzer.cs index 74f53620b1c0e57320cf3b1d6df74c5b9dd860c6..fd18ae27082a308992f4b1c57338724b75971ace 100644 --- a/src/Features/Core/Portable/Diagnostics/Analyzers/DocumentDiagnosticAnalyzer.cs +++ b/src/Features/Core/Portable/Diagnostics/Analyzers/DocumentDiagnosticAnalyzer.cs @@ -20,7 +20,11 @@ internal abstract class DocumentDiagnosticAnalyzer : DiagnosticAnalyzer /// /// it is not allowed one to implement both DocumentDiagnosticAnalzyer and DiagnosticAnalyzer /// +#pragma warning disable RS1026 // Enable concurrent execution +#pragma warning disable RS1025 // Configure generated code analysis public sealed override void Initialize(AnalysisContext context) +#pragma warning restore RS1025 // Configure generated code analysis +#pragma warning restore RS1026 // Enable concurrent execution { } diff --git a/src/Features/Core/Portable/Diagnostics/Analyzers/ProjectDiagnosticAnalyzer.cs b/src/Features/Core/Portable/Diagnostics/Analyzers/ProjectDiagnosticAnalyzer.cs index a70ba68e640fab2629296c757a504edad658e602..f69727f9ba774577c4d54b1ac80e941031e3bbab 100644 --- a/src/Features/Core/Portable/Diagnostics/Analyzers/ProjectDiagnosticAnalyzer.cs +++ b/src/Features/Core/Portable/Diagnostics/Analyzers/ProjectDiagnosticAnalyzer.cs @@ -18,7 +18,11 @@ internal abstract class ProjectDiagnosticAnalyzer : DiagnosticAnalyzer /// /// it is not allowed one to implement both ProjectDiagnosticAnalzyer and DiagnosticAnalyzer /// +#pragma warning disable RS1026 // Enable concurrent execution +#pragma warning disable RS1025 // Configure generated code analysis public sealed override void Initialize(AnalysisContext context) +#pragma warning restore RS1025 // Configure generated code analysis +#pragma warning restore RS1026 // Enable concurrent execution { } diff --git a/src/Features/Core/Portable/Diagnostics/Analyzers/UnboundIdentifiersDiagnosticAnalyzerBase.cs b/src/Features/Core/Portable/Diagnostics/Analyzers/UnboundIdentifiersDiagnosticAnalyzerBase.cs index ccaf517881a5f198946d80435866350869e49775..786be27f5b1daa8c0ab3ed0b98f05d294f58ed2d 100644 --- a/src/Features/Core/Portable/Diagnostics/Analyzers/UnboundIdentifiersDiagnosticAnalyzerBase.cs +++ b/src/Features/Core/Portable/Diagnostics/Analyzers/UnboundIdentifiersDiagnosticAnalyzerBase.cs @@ -26,6 +26,7 @@ internal abstract class UnboundIdentifiersDiagnosticAnalyzerBase SupportedDiagnostics public override void Initialize(AnalysisContext context) { context.EnableConcurrentExecution(); + context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); context.RegisterSemanticModelAction(this.AnalyzeSemanticModel); } diff --git a/src/Features/Core/Portable/ValidateFormatString/AbstractValidateFormatStringDiagnosticAnalyzer.cs b/src/Features/Core/Portable/ValidateFormatString/AbstractValidateFormatStringDiagnosticAnalyzer.cs index ba26fbed6b0c06c205d9f0b83a2662b6c516f65b..309d66ff267d04c05eadabf0d31b819420a2d4f6 100644 --- a/src/Features/Core/Portable/ValidateFormatString/AbstractValidateFormatStringDiagnosticAnalyzer.cs +++ b/src/Features/Core/Portable/ValidateFormatString/AbstractValidateFormatStringDiagnosticAnalyzer.cs @@ -65,6 +65,7 @@ public override ImmutableArray SupportedDiagnostics public override void Initialize(AnalysisContext context) { context.EnableConcurrentExecution(); + context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); context.RegisterCompilationStartAction(startContext => {