2 instantiations of AnalyzedSwitchSection
Microsoft.CodeAnalysis.Features (2)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (2)
83
sections.Add(new
AnalyzedSwitchSection
(labels: default, defaultBodyOpt, defaultBodyOpt.Syntax));
198
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)
73
public (ImmutableArray<
AnalyzedSwitchSection
>, TExpressionSyntax TargetExpression) AnalyzeIfStatementSequence(ReadOnlySpan<IOperation> operations)
75
using var _ = ArrayBuilder<
AnalyzedSwitchSection
>.GetInstance(out var sections);
99
ArrayBuilder<
AnalyzedSwitchSection
> sections,
154
private bool ParseIfStatement(IOperation operation, ArrayBuilder<
AnalyzedSwitchSection
> sections, out IOperation? defaultBodyOpt)
159
var
section = ParseSwitchSection(op);
183
private bool ParseIfStatementOrBlock(IOperation op, ArrayBuilder<
AnalyzedSwitchSection
> sections, out IOperation? defaultBodyOpt)
190
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)