46 references to Sections
Microsoft.CodeAnalysis.CSharp (18)
_generated\0\Syntax.xml.Main.Generated.cs (1)
1933
=> node.Update(VisitList(node.AttributeLists), VisitToken(node.SwitchKeyword), VisitToken(node.OpenParenToken), (ExpressionSyntax?)Visit(node.Expression) ?? throw new ArgumentNullException("expression"), VisitToken(node.CloseParenToken), VisitToken(node.OpenBraceToken), VisitList(node.
Sections
), VisitToken(node.CloseBraceToken));
_generated\2\Syntax.xml.Syntax.Generated.cs (9)
8579
if (attributeLists != this.AttributeLists || switchKeyword != this.SwitchKeyword || openParenToken != this.OpenParenToken || expression != this.Expression || closeParenToken != this.CloseParenToken || openBraceToken != this.OpenBraceToken || sections != this.
Sections
|| closeBraceToken != this.CloseBraceToken)
8590
public new SwitchStatementSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.SwitchKeyword, this.OpenParenToken, this.Expression, this.CloseParenToken, this.OpenBraceToken, this.
Sections
, this.CloseBraceToken);
8591
public SwitchStatementSyntax WithSwitchKeyword(SyntaxToken switchKeyword) => Update(this.AttributeLists, switchKeyword, this.OpenParenToken, this.Expression, this.CloseParenToken, this.OpenBraceToken, this.
Sections
, this.CloseBraceToken);
8592
public SwitchStatementSyntax WithOpenParenToken(SyntaxToken openParenToken) => Update(this.AttributeLists, this.SwitchKeyword, openParenToken, this.Expression, this.CloseParenToken, this.OpenBraceToken, this.
Sections
, this.CloseBraceToken);
8593
public SwitchStatementSyntax WithExpression(ExpressionSyntax expression) => Update(this.AttributeLists, this.SwitchKeyword, this.OpenParenToken, expression, this.CloseParenToken, this.OpenBraceToken, this.
Sections
, this.CloseBraceToken);
8594
public SwitchStatementSyntax WithCloseParenToken(SyntaxToken closeParenToken) => Update(this.AttributeLists, this.SwitchKeyword, this.OpenParenToken, this.Expression, closeParenToken, this.OpenBraceToken, this.
Sections
, this.CloseBraceToken);
8595
public SwitchStatementSyntax WithOpenBraceToken(SyntaxToken openBraceToken) => Update(this.AttributeLists, this.SwitchKeyword, this.OpenParenToken, this.Expression, this.CloseParenToken, openBraceToken, this.
Sections
, this.CloseBraceToken);
8597
public SwitchStatementSyntax WithCloseBraceToken(SyntaxToken closeBraceToken) => Update(this.AttributeLists, this.SwitchKeyword, this.OpenParenToken, this.Expression, this.CloseParenToken, this.OpenBraceToken, this.
Sections
, closeBraceToken);
8601
public SwitchStatementSyntax AddSections(params SwitchSectionSyntax[] items) => WithSections(this.
Sections
.AddRange(items));
Binder\LocalBinderFactory.cs (1)
738
foreach (SwitchSectionSyntax section in node.
Sections
)
Binder\SwitchBinder.cs (3)
138
foreach (var section in SwitchSyntax.
Sections
)
150
foreach (var section in SwitchSyntax.
Sections
)
180
foreach (var section in SwitchSyntax.
Sections
)
Binder\SwitchBinder_Patterns.cs (3)
33
if (node.
Sections
.Count == 0)
176
var boundSwitchSectionsBuilder = ArrayBuilder<BoundSwitchSection>.GetInstance(SwitchSyntax.
Sections
.Count);
178
foreach (SwitchSectionSyntax sectionSyntax in SwitchSyntax.
Sections
)
FlowAnalysis\AbstractFlowPass_Switch.cs (1)
106
foreach (var sectionSyntax in ((SwitchStatementSyntax)node.Syntax).
Sections
)
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\roslyn\src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (2)
110
var sections = switchStatement.
Sections
;
178
if (switchStatement.
Sections
.Any(section => section.Labels.Any(label => IsDefaultSwitchLabel(label))))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
105
var lastSection = switchStatement.
Sections
.Last() == node;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
470
var originalSwitchLabels = originalSwitchStatement.
Sections
.SelectMany(section => section.Labels).ToArray();
471
var newSwitchLabels = newSwitchStatement.
Sections
.SelectMany(section => section.Labels).ToArray();
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (2)
222
var switchArms = node.
Sections
271
node.
Sections
, node.CloseBraceToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
2210
if (switchStatement.
Sections
.SelectMany(ss => ss.Labels)
Microsoft.CodeAnalysis.CSharp.Features (10)
Debugging\CSharpProximityExpressionsService.Worker.cs (1)
272
foreach (var section in switchStatement.
Sections
)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (3)
852
var hasDecitionTree = oldNode.
Sections
.Any(s => s.Labels.Any(l => l is CasePatternSwitchLabelSyntax));
2910
=> oldSwitch.
Sections
.SequenceEqual(newSwitch.
Sections
, AreSwitchSectionsEquivalent);
Highlighting\KeywordHighlighters\SwitchStatementHighlighter.cs (1)
41
foreach (var switchSection in switchStatement.
Sections
)
src\roslyn\src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (2)
110
var sections = switchStatement.
Sections
;
178
if (switchStatement.
Sections
.Any(section => section.Labels.Any(label => IsDefaultSwitchLabel(label))))
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (2)
222
var switchArms = node.
Sections
271
node.
Sections
, node.CloseBraceToken);
Structure\Providers\SwitchStatementStructureProvider.cs (1)
28
foreach (var section in node.
Sections
)
Microsoft.CodeAnalysis.CSharp.Workspaces (6)
CodeGeneration\CSharpSyntaxGenerator.cs (2)
2315
return statement?.
Sections
?? [];
2325
var newSections = statement.
Sections
.InsertRange(index, switchSections.Cast<SwitchSectionSyntax>());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
105
var lastSection = switchStatement.
Sections
.Last() == node;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
470
var originalSwitchLabels = originalSwitchStatement.
Sections
.SelectMany(section => section.Labels).ToArray();
471
var newSwitchLabels = newSwitchStatement.
Sections
.SelectMany(section => section.Labels).ToArray();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
2210
if (switchStatement.
Sections
.SelectMany(ss => ss.Labels)
Roslyn.Diagnostics.CSharp.Analyzers (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
105
var lastSection = switchStatement.
Sections
.Last() == node;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
470
var originalSwitchLabels = originalSwitchStatement.
Sections
.SelectMany(section => section.Labels).ToArray();
471
var newSwitchLabels = newSwitchStatement.
Sections
.SelectMany(section => section.Labels).ToArray();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
2210
if (switchStatement.
Sections
.SelectMany(ss => ss.Labels)