diff --git a/src/Spectre.Console.Analyzer/Analyzers/NoConcurrentLiveRenderablesAnalyzer.cs b/src/Spectre.Console.Analyzer/Analyzers/NoConcurrentLiveRenderablesAnalyzer.cs index 2f1fb74..d0c7295 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 d26b7d5..822c6fa 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()