60 references to Statements
Microsoft.CodeAnalysis.CSharp (10)
_generated\0\Syntax.xml.Main.Generated.cs (1)
1936
=> node.Update(VisitList(node.Labels), VisitList(node.
Statements
));
_generated\2\Syntax.xml.Syntax.Generated.cs (3)
8652
if (labels != this.Labels || statements != this.
Statements
)
8662
public SwitchSectionSyntax WithLabels(SyntaxList<SwitchLabelSyntax> labels) => Update(labels, this.
Statements
);
8666
public SwitchSectionSyntax AddStatements(params StatementSyntax[] items) => WithStatements(this.
Statements
.AddRange(items));
Binder\LocalBinderFactory.cs (1)
772
foreach (StatementSyntax statement in node.
Statements
)
Binder\SwitchBinder.cs (3)
140
builder.AddRange(BuildLocals(section.
Statements
, GetBinder(section)));
152
builder.AddRange(BuildLocalFunctions(section.
Statements
));
186
BuildLabels(section.
Statements
, ref labels);
Binder\SwitchBinder_Patterns.cs (2)
210
var boundStatementsBuilder = ArrayBuilder<BoundStatement>.GetInstance(node.
Statements
.Count);
211
foreach (StatementSyntax statement in node.
Statements
)
Microsoft.CodeAnalysis.CSharp.CodeStyle (9)
src\roslyn\src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (4)
220
switch (section.
Statements
.Count)
223
case 2 when section.
Statements
[1].IsKind(SyntaxKind.BreakStatement) || section.
Statements
[0].IsKind(SyntaxKind.SwitchStatement):
224
return Visit(section.
Statements
[0]);
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\RemoveUnreachableCodeHelpers.cs (1)
23
siblingStatements = [.. switchSection.
Statements
];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (3)
78
if (section is { Labels.Count: 0,
Statements
.Count: 0 })
95
var firstStatementIsBlock = section.
Statements
is [(kind: SyntaxKind.Block), ..];
107
if (section.
Statements
is not ([var firstStatement, ..] and [.., var lastStatement]))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpBlockFacts.cs (1)
41
SwitchSectionSyntax switchSection => switchSection.
Statements
,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (7)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (3)
127
expression: RewriteStatements(node.
Statements
));
227
tokensForTrailingTrivia: new[] { s.
Statements
[0].GetFirstToken(), s.
Statements
[0].GetLastToken() },
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
170
var firstStatement = switchCaseBlock.
Statements
.FirstOrDefault();
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (1)
64
: ((SwitchSectionSyntax)newParentScope).
Statements
.First();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
415
foreach (var statement in section.
Statements
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
174
if (node is not SwitchSectionSyntax {
Statements
: [var firstStatement, ..] and [.., var lastStatement] })
Microsoft.CodeAnalysis.CSharp.Features (22)
Debugging\CSharpProximityExpressionsService.Worker.cs (1)
274
AddLastStatementOfConstruct(section.
Statements
.LastOrDefault());
EditAndContinue\BreakpointSpans.cs (2)
556
if (switchLabel.Parent is not SwitchSectionSyntax switchSection || switchSection.
Statements
.Count == 0)
561
return TryCreateSpanForNode(switchSection.
Statements
[0], position);
EditAndContinue\SyntaxComparer.cs (2)
767
&& SyntaxFactory.AreEquivalent(left.
Statements
, right.
Statements
, ignoreChildNode: HasLabel);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (1)
142
return node.WithStatements([.. VisitList(ReplaceStatements(node.
Statements
))]);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.MultipleStatementsCodeGenerator.cs (1)
74
SwitchSectionSyntax switchSectionNode => switchSectionNode.
Statements
,
IntroduceUsingStatement\CSharpIntroduceUsingStatementCodeRefactoringProvider.cs (1)
48
SwitchSectionSyntax switchSection => switchSection.
Statements
,
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
536
SwitchSectionSyntax switchSection => switchSection.
Statements
,
InvertIf\CSharpInvertIfCodeRefactoringProvider.cs (1)
97
SwitchSectionSyntax n => n.
Statements
,
src\roslyn\src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (4)
220
switch (section.
Statements
.Count)
223
case 2 when section.
Statements
[1].IsKind(SyntaxKind.BreakStatement) || section.
Statements
[0].IsKind(SyntaxKind.SwitchStatement):
224
return Visit(section.
Statements
[0]);
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\RemoveUnreachableCodeHelpers.cs (1)
23
siblingStatements = [.. switchSection.
Statements
];
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (3)
127
expression: RewriteStatements(node.
Statements
));
227
tokensForTrailingTrivia: new[] { s.
Statements
[0].GetFirstToken(), s.
Statements
[0].GetLastToken() },
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
170
var firstStatement = switchCaseBlock.
Statements
.FirstOrDefault();
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (1)
64
: ((SwitchSectionSyntax)newParentScope).
Statements
.First();
Structure\Providers\SwitchStatementStructureProvider.cs (2)
30
if (section.Labels.Count > 0 && section.
Statements
.Count > 0)
33
var end = section.
Statements
.Last().Span.End;
Microsoft.CodeAnalysis.CSharp.Workspaces (6)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (3)
78
if (section is { Labels.Count: 0,
Statements
.Count: 0 })
95
var firstStatementIsBlock = section.
Statements
is [(kind: SyntaxKind.Block), ..];
107
if (section.
Statements
is not ([var firstStatement, ..] and [.., var lastStatement]))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpBlockFacts.cs (1)
41
SwitchSectionSyntax switchSection => switchSection.
Statements
,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
415
foreach (var statement in section.
Statements
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
174
if (node is not SwitchSectionSyntax {
Statements
: [var firstStatement, ..] and [.., var lastStatement] })
Roslyn.Diagnostics.CSharp.Analyzers (6)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (3)
78
if (section is { Labels.Count: 0,
Statements
.Count: 0 })
95
var firstStatementIsBlock = section.
Statements
is [(kind: SyntaxKind.Block), ..];
107
if (section.
Statements
is not ([var firstStatement, ..] and [.., var lastStatement]))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpBlockFacts.cs (1)
41
SwitchSectionSyntax switchSection => switchSection.
Statements
,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
415
foreach (var statement in section.
Statements
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
174
if (node is not SwitchSectionSyntax {
Statements
: [var firstStatement, ..] and [.., var lastStatement] })