21 references to SwitchKeyword
Microsoft.CodeAnalysis.CSharp (12)
Binder\Binder_Expressions.cs (1)
302
diagnostics.Add(ErrorCode.ERR_SwitchExpressionNoBestType, exprSyntax.
SwitchKeyword
.GetLocation());
Binder\Binder_Patterns.cs (1)
148
MessageID.IDS_FeatureRecursivePatterns.CheckFeatureAvailability(diagnostics, node.
SwitchKeyword
);
Binder\SwitchExpressionBinder.cs (1)
103
node.
SwitchKeyword
.GetLocation(),
FlowAnalysis\NullableWalker_Patterns.cs (1)
909
((SwitchExpressionSyntax)node.Syntax).
SwitchKeyword
.GetLocation(),
Lowering\LocalRewriter\LocalRewriter_SwitchExpression.cs (1)
76
var spanStart = syntax.
SwitchKeyword
.Span.Start;
Syntax.xml.Main.Generated.cs (1)
1936
=> node.Update((ExpressionSyntax?)Visit(node.GoverningExpression) ?? throw new ArgumentNullException("governingExpression"), VisitToken(node.
SwitchKeyword
), VisitToken(node.OpenBraceToken), VisitList(node.Arms), VisitToken(node.CloseBraceToken));
Syntax.xml.Syntax.Generated.cs (5)
8865
if (governingExpression != this.GoverningExpression || switchKeyword != this.
SwitchKeyword
|| openBraceToken != this.OpenBraceToken || arms != this.Arms || closeBraceToken != this.CloseBraceToken)
8875
public SwitchExpressionSyntax WithGoverningExpression(ExpressionSyntax governingExpression) => Update(governingExpression, this.
SwitchKeyword
, this.OpenBraceToken, this.Arms, this.CloseBraceToken);
8877
public SwitchExpressionSyntax WithOpenBraceToken(SyntaxToken openBraceToken) => Update(this.GoverningExpression, this.
SwitchKeyword
, openBraceToken, this.Arms, this.CloseBraceToken);
8878
public SwitchExpressionSyntax WithArms(SeparatedSyntaxList<SwitchExpressionArmSyntax> arms) => Update(this.GoverningExpression, this.
SwitchKeyword
, this.OpenBraceToken, arms, this.CloseBraceToken);
8879
public SwitchExpressionSyntax WithCloseBraceToken(SyntaxToken closeBraceToken) => Update(this.GoverningExpression, this.
SwitchKeyword
, this.OpenBraceToken, this.Arms, closeBraceToken);
Syntax\LambdaUtilities.cs (1)
483
return (node is SwitchExpressionSyntax switchExpression) ? switchExpression.
SwitchKeyword
.SpanStart : node.SpanStart;
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Analyzers\CSharp\Analyzers\PopulateSwitch\CSharpPopulateSwitchExpressionDiagnosticAnalyzer.cs (1)
16
=> switchBlock.
SwitchKeyword
.GetLocation();
Microsoft.CodeAnalysis.CSharp.Features (6)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (3)
263
if (position == switchExpression.
SwitchKeyword
.SpanStart)
347
SwitchExpressionPart.SwitchBody => TextSpan.FromBounds(node.
SwitchKeyword
.SpanStart, node.CloseBraceToken.Span.End),
1924
return ((SwitchExpressionSyntax)node).
SwitchKeyword
.Span;
src\Analyzers\CSharp\Analyzers\PopulateSwitch\CSharpPopulateSwitchExpressionDiagnosticAnalyzer.cs (1)
16
=> switchBlock.
SwitchKeyword
.GetLocation();
src\Compilers\CSharp\Portable\Syntax\LambdaUtilities.cs (1)
483
return (node is SwitchExpressionSyntax switchExpression) ? switchExpression.
SwitchKeyword
.SpanStart : node.SpanStart;
Structure\Providers\SwitchExpressionStructureProvider.cs (1)
24
textSpan: TextSpan.FromBounds(node.
SwitchKeyword
.Span.End, node.CloseBraceToken.Span.End),
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Generated\Syntax.Test.xml.Generated.cs (2)
12861
Assert.Equal(SyntaxKind.SwitchKeyword, node.
SwitchKeyword
.Kind());
12865
var newNode = node.WithGoverningExpression(node.GoverningExpression).WithSwitchKeyword(node.
SwitchKeyword
).WithOpenBraceToken(node.OpenBraceToken).WithArms(node.Arms).WithCloseBraceToken(node.CloseBraceToken);