15 references to Labels
Microsoft.CodeAnalysis.CSharp.Features (6)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (6)
39
if (section.
Labels
.IsDefault)
42
var pattern = AsPatternSyntax(section.
Labels
[0].Pattern, feature);
43
var whenClause = AsWhenClause(section.
Labels
[0]);
45
Debug.Assert(whenClause == null || section.
Labels
.Length == 1, "We shouldn't have guards when we're combining multiple cases into a single arm");
47
for (var i = 1; i < section.
Labels
.Length; i++)
49
var label = section.
Labels
[i];
Microsoft.CodeAnalysis.Features (9)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (7)
115
var labelCount = sections.Sum(section => section.
Labels
.IsDefault ? 1 : section.
Labels
.Length);
128
if (!sections.Any(static section => section.
Labels
.IsDefault))
162
if (section.
Labels
.IsDefault)
166
if (section.
Labels
.Length == 1)
169
if (section.
Labels
.Length == 0)
177
return supportsOrPattern && section.
Labels
.All(label => label.Guards.IsDefaultOrEmpty);
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (2)
61
var sectionNode = section.
Labels
.IsDefault
63
: generator.SwitchSectionFromLabels(section.
Labels
.Select(label => AsSwitchLabelSyntax(label, feature)), statements);