2 instantiations of AnalyzedSwitchSection
Microsoft.CodeAnalysis.Features (2)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (2)
88
sections.Add(new
AnalyzedSwitchSection
(labels: default, defaultBodyOpt, defaultBodyOpt.Syntax));
189
return new
AnalyzedSwitchSection
(labels.ToImmutable(), operation.WhenTrue, operation.Syntax);
16 references to AnalyzedSwitchSection
Microsoft.CodeAnalysis.CSharp.Features (2)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (2)
30
public override SyntaxNode CreateSwitchExpressionStatement(SyntaxNode target, ImmutableArray<
AnalyzedSwitchSection
> sections, Feature feature)
38
private static SwitchExpressionArmSyntax AsSwitchExpressionArmSyntax(
AnalyzedSwitchSection
section, Feature feature)
Microsoft.CodeAnalysis.Features (13)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (7)
78
public (ImmutableArray<
AnalyzedSwitchSection
>, SyntaxNode TargetExpression) AnalyzeIfStatementSequence(ReadOnlySpan<IOperation> operations)
80
using var _ = ArrayBuilder<
AnalyzedSwitchSection
>.GetInstance(out var sections);
102
private bool ParseIfStatementSequence(ReadOnlySpan<IOperation> operations, ArrayBuilder<
AnalyzedSwitchSection
> sections, out IOperation? defaultBodyOpt)
145
private bool ParseIfStatement(IOperation operation, ArrayBuilder<
AnalyzedSwitchSection
> sections, out IOperation? defaultBodyOpt)
150
var
section = ParseSwitchSection(op);
174
private bool ParseIfStatementOrBlock(IOperation op, ArrayBuilder<
AnalyzedSwitchSection
> sections, out IOperation? defaultBodyOpt)
181
private
AnalyzedSwitchSection
? ParseSwitchSection(IConditionalOperation operation)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (3)
75
[NotNullWhen(true)] out ImmutableArray<
AnalyzedSwitchSection
> sections,
124
bool supportsOrPattern, ImmutableArray<
AnalyzedSwitchSection
> sections)
154
static bool CanConvertSectionForSwitchExpression(bool supportsOrPattern,
AnalyzedSwitchSection
section)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (3)
22
public abstract SyntaxNode CreateSwitchExpressionStatement(SyntaxNode target, ImmutableArray<
AnalyzedSwitchSection
> sections, Feature feature);
32
ImmutableArray<
AnalyzedSwitchSection
> sections,
60
private SyntaxNode AsSwitchSectionSyntax(
AnalyzedSwitchSection
section, SyntaxGenerator generator, Feature feature)
Microsoft.CodeAnalysis.VisualBasic.Features (1)
ConvertIfToSwitch\VisualBasicConvertIfToSwitchCodeRefactoringProvider.Rewriting.vb (1)
22
Public Overrides Function CreateSwitchExpressionStatement(target As SyntaxNode, sections As ImmutableArray(Of
AnalyzedSwitchSection
), feature As Feature) As SyntaxNode