2 instantiations of AnalyzedSwitchSection
Microsoft.CodeAnalysis.Features (2)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (2)
82
sections.Add(new
AnalyzedSwitchSection
(labels: default, defaultBodyOpt, defaultBodyOpt.Syntax));
197
return new
AnalyzedSwitchSection
(labels.ToImmutable(), operation.WhenTrue, operation.Syntax);
15 references to AnalyzedSwitchSection
Microsoft.CodeAnalysis.CSharp.Features (2)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (2)
31
ExpressionSyntax target, ImmutableArray<
AnalyzedSwitchSection
> sections, Feature feature)
37
private static SwitchExpressionArmSyntax AsSwitchExpressionArmSyntax(
AnalyzedSwitchSection
section, Feature feature)
Microsoft.CodeAnalysis.Features (13)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (7)
72
public (ImmutableArray<
AnalyzedSwitchSection
>, TExpressionSyntax TargetExpression) AnalyzeIfStatementSequence(ReadOnlySpan<IOperation> operations)
74
using var _ = ArrayBuilder<
AnalyzedSwitchSection
>.GetInstance(out var sections);
98
ArrayBuilder<
AnalyzedSwitchSection
> sections,
153
private bool ParseIfStatement(IOperation operation, ArrayBuilder<
AnalyzedSwitchSection
> sections, out IOperation? defaultBodyOpt)
158
var
section = ParseSwitchSection(op);
182
private bool ParseIfStatementOrBlock(IOperation op, ArrayBuilder<
AnalyzedSwitchSection
> sections, out IOperation? defaultBodyOpt)
189
private
AnalyzedSwitchSection
? ParseSwitchSection(IConditionalOperation operation)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (3)
76
[NotNullWhen(true)] out ImmutableArray<
AnalyzedSwitchSection
> sections,
125
bool supportsOrPattern, ImmutableArray<
AnalyzedSwitchSection
> sections)
155
static bool CanConvertSectionForSwitchExpression(bool supportsOrPattern,
AnalyzedSwitchSection
section)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (3)
21
public abstract SyntaxNode CreateSwitchExpressionStatement(TExpressionSyntax target, ImmutableArray<
AnalyzedSwitchSection
> sections, Feature feature);
31
ImmutableArray<
AnalyzedSwitchSection
> sections,
58
private SyntaxNode AsSwitchSectionSyntax(
AnalyzedSwitchSection
section, SyntaxGenerator generator, Feature feature)