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