33 references to SwitchKeyword
Microsoft.CodeAnalysis.CSharp (11)
Compilation\MemberSemanticModel.cs (1)
392
if (LookupPosition.IsBetweenTokens(position, switchStmt.
SwitchKeyword
, switchStmt.OpenBraceToken))
Lowering\Instrumentation\DebugInfoInjector.cs (1)
427
switchSyntax.
SwitchKeyword
.SpanStart,
Syntax.xml.Main.Generated.cs (1)
1921
=> 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));
Syntax.xml.Syntax.Generated.cs (8)
8533
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)
8544
public new SwitchStatementSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.
SwitchKeyword
, this.OpenParenToken, this.Expression, this.CloseParenToken, this.OpenBraceToken, this.Sections, this.CloseBraceToken);
8546
public SwitchStatementSyntax WithOpenParenToken(SyntaxToken openParenToken) => Update(this.AttributeLists, this.
SwitchKeyword
, openParenToken, this.Expression, this.CloseParenToken, this.OpenBraceToken, this.Sections, this.CloseBraceToken);
8547
public SwitchStatementSyntax WithExpression(ExpressionSyntax expression) => Update(this.AttributeLists, this.
SwitchKeyword
, this.OpenParenToken, expression, this.CloseParenToken, this.OpenBraceToken, this.Sections, this.CloseBraceToken);
8548
public SwitchStatementSyntax WithCloseParenToken(SyntaxToken closeParenToken) => Update(this.AttributeLists, this.
SwitchKeyword
, this.OpenParenToken, this.Expression, closeParenToken, this.OpenBraceToken, this.Sections, this.CloseBraceToken);
8549
public SwitchStatementSyntax WithOpenBraceToken(SyntaxToken openBraceToken) => Update(this.AttributeLists, this.
SwitchKeyword
, this.OpenParenToken, this.Expression, this.CloseParenToken, openBraceToken, this.Sections, this.CloseBraceToken);
8550
public SwitchStatementSyntax WithSections(SyntaxList<SwitchSectionSyntax> sections) => Update(this.AttributeLists, this.
SwitchKeyword
, this.OpenParenToken, this.Expression, this.CloseParenToken, this.OpenBraceToken, sections, this.CloseBraceToken);
8551
public SwitchStatementSyntax WithCloseBraceToken(SyntaxToken closeBraceToken) => Update(this.AttributeLists, this.
SwitchKeyword
, this.OpenParenToken, this.Expression, this.CloseParenToken, this.OpenBraceToken, this.Sections, closeBraceToken);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (2)
61
switchExpression, switchStatement.
SwitchKeyword
.LeadingTrivia, declaratorToRemoveType, nodeToGenerate, generateDeclaration);
268
return node.Update(node.
SwitchKeyword
, node.OpenParenToken,
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (1)
603
return switchStatementNode.
SwitchKeyword
.Span.End;
AutomaticCompletion\AutomaticLineEnderCommandHandler_Helpers.cs (1)
638
=> !switchStatementNode.
SwitchKeyword
.IsMissing && switchStatementNode.OpenBraceToken.IsMissing;
Microsoft.CodeAnalysis.CSharp.Features (4)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
1801
return TextSpan.FromBounds(switchStatement.
SwitchKeyword
.SpanStart,
Highlighting\KeywordHighlighters\SwitchStatementHighlighter.cs (1)
39
spans.Add(switchStatement.
SwitchKeyword
.Span);
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (2)
61
switchExpression, switchStatement.
SwitchKeyword
.LeadingTrivia, declaratorToRemoveType, nodeToGenerate, generateDeclaration);
268
return node.Update(node.
SwitchKeyword
, node.OpenParenToken,
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (14)
Generated\Syntax.Test.xml.Generated.cs (2)
12797
Assert.Equal(SyntaxKind.SwitchKeyword, node.
SwitchKeyword
.Kind());
12804
var newNode = node.WithAttributeLists(node.AttributeLists).WithSwitchKeyword(node.
SwitchKeyword
).WithOpenParenToken(node.OpenParenToken).WithExpression(node.Expression).WithCloseParenToken(node.CloseParenToken).WithOpenBraceToken(node.OpenBraceToken).WithSections(node.Sections).WithCloseBraceToken(node.CloseBraceToken);
Parsing\StatementParsingTests.cs (12)
2129
Assert.NotEqual(default, ss.
SwitchKeyword
);
2130
Assert.Equal(SyntaxKind.SwitchKeyword, ss.
SwitchKeyword
.Kind());
2152
Assert.NotEqual(default, ss.
SwitchKeyword
);
2153
Assert.Equal(SyntaxKind.SwitchKeyword, ss.
SwitchKeyword
.Kind());
2187
Assert.NotEqual(default, ss.
SwitchKeyword
);
2188
Assert.Equal(SyntaxKind.SwitchKeyword, ss.
SwitchKeyword
.Kind());
2234
Assert.NotEqual(default, ss.
SwitchKeyword
);
2235
Assert.Equal(SyntaxKind.SwitchKeyword, ss.
SwitchKeyword
.Kind());
2267
Assert.NotEqual(default, ss.
SwitchKeyword
);
2268
Assert.Equal(SyntaxKind.SwitchKeyword, ss.
SwitchKeyword
.Kind());
2309
Assert.NotEqual(default, ss.
SwitchKeyword
);
2310
Assert.Equal(SyntaxKind.SwitchKeyword, ss.
SwitchKeyword
.Kind());