diff --git a/src/Spectre.Console.Analyzer/Analyzers/NoConcurrentLiveRenderablesAnalyzer.cs b/src/Spectre.Console.Analyzer/Analyzers/NoConcurrentLiveRenderablesAnalyzer.cs index 2f1fb74d..d0c72955 100644 --- a/src/Spectre.Console.Analyzer/Analyzers/NoConcurrentLiveRenderablesAnalyzer.cs +++ b/src/Spectre.Console.Analyzer/Analyzers/NoConcurrentLiveRenderablesAnalyzer.cs @@ -38,9 +38,7 @@ public class NoConcurrentLiveRenderablesAnalyzer : SpectreAnalyzer return; } -#pragma warning disable RS1030 // Do not invoke Compilation.GetSemanticModel() method within a diagnostic analyzer - var model = context.Compilation.GetSemanticModel(context.Operation.Syntax.SyntaxTree); -#pragma warning restore RS1030 // Do not invoke Compilation.GetSemanticModel() method within a diagnostic analyzer + var model = context.Operation.SemanticModel!; var parentInvocations = invocationOperation .Syntax.Ancestors() .OfType() diff --git a/src/Spectre.Console.Analyzer/Analyzers/NoPromptsDuringLiveRenderablesAnalyzer.cs b/src/Spectre.Console.Analyzer/Analyzers/NoPromptsDuringLiveRenderablesAnalyzer.cs index d26b7d57..822c6fac 100644 --- a/src/Spectre.Console.Analyzer/Analyzers/NoPromptsDuringLiveRenderablesAnalyzer.cs +++ b/src/Spectre.Console.Analyzer/Analyzers/NoPromptsDuringLiveRenderablesAnalyzer.cs @@ -40,9 +40,7 @@ public class NoPromptsDuringLiveRenderablesAnalyzer : SpectreAnalyzer return; } -#pragma warning disable RS1030 // Do not invoke Compilation.GetSemanticModel() method within a diagnostic analyzer - var model = context.Compilation.GetSemanticModel(context.Operation.Syntax.SyntaxTree); -#pragma warning restore RS1030 // Do not invoke Compilation.GetSemanticModel() method within a diagnostic analyzer + var model = context.Operation.SemanticModel!; var parentInvocations = invocationOperation .Syntax.Ancestors() .OfType()