mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-14 16:02:50 +08:00
Simplify access to the SemanticModel in analyzers
This commit is contained in:
parent
0bab835293
commit
142942b8a2
@ -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<InvocationExpressionSyntax>()
|
||||
|
@ -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<InvocationExpressionSyntax>()
|
||||
|
Loading…
x
Reference in New Issue
Block a user