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