252 references to SwitchKeyword
Microsoft.CodeAnalysis.CSharp (14)
Parser\LanguageParser.cs (9)
7865
|| (this.CurrentToken.ContextualKind is SyntaxKind.
SwitchKeyword
or SyntaxKind.WithKeyword && this.PeekToken(1).Kind is SyntaxKind.OpenBraceToken);
7960
case SyntaxKind.
SwitchKeyword
:
8775
case SyntaxKind.
SwitchKeyword
:
9663
Debug.Assert(this.CurrentToken.Kind is SyntaxKind.
SwitchKeyword
or SyntaxKind.CaseKeyword);
9692
switchKeyword = EatToken(SyntaxKind.
SwitchKeyword
);
9700
switchKeyword = this.EatToken(SyntaxKind.
SwitchKeyword
);
10624
case SyntaxKind.
SwitchKeyword
:
11163
if (token1Kind == SyntaxKind.
SwitchKeyword
&& this.PeekToken(1).Kind == SyntaxKind.OpenBraceToken)
12644
case SyntaxKind.
SwitchKeyword
:
Syntax\SyntaxFactory.cs (1)
2728
SyntaxFactory.Token(SyntaxKind.
SwitchKeyword
),
Syntax\SyntaxKindFacts.cs (2)
907
return SyntaxKind.
SwitchKeyword
;
1555
case SyntaxKind.
SwitchKeyword
:
Syntax\SyntaxNormalizer.cs (2)
275
case SyntaxKind.
SwitchKeyword
when currentToken.Parent is SwitchExpressionSyntax:
677
if (next.IsKind(SyntaxKind.
SwitchKeyword
) && next.Parent is SwitchExpressionSyntax)
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
88
public static readonly SyntaxToken SwitchKeyword = Token(SyntaxKind.
SwitchKeyword
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (1)
154
(previousKind == SyntaxKind.IfKeyword || previousKind == SyntaxKind.WhileKeyword || previousKind == SyntaxKind.
SwitchKeyword
||
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
250
Token(leading: default, SyntaxKind.
SwitchKeyword
, node.CloseParenToken.TrailingTrivia),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2645
token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.
SwitchKeyword
))
Microsoft.CodeAnalysis.CSharp.Features (3)
Completion\KeywordRecommenders\SwitchKeywordRecommender.cs (1)
13
: base(SyntaxKind.
SwitchKeyword
)
Highlighting\KeywordHighlighters\SwitchStatementHighlighter.cs (1)
27
is SyntaxKind.
SwitchKeyword
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
250
Token(leading: default, SyntaxKind.
SwitchKeyword
, node.CloseParenToken.TrailingTrivia),
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (226)
Generated\Syntax.Test.xml.Generated.cs (8)
428
=> InternalSyntaxFactory.SwitchStatement(new Microsoft.CodeAnalysis.Syntax.InternalSyntax.SyntaxList<Syntax.InternalSyntax.AttributeListSyntax>(), InternalSyntaxFactory.Token(SyntaxKind.
SwitchKeyword
), null, GenerateIdentifierName(), null, InternalSyntaxFactory.Token(SyntaxKind.OpenBraceToken), new Microsoft.CodeAnalysis.Syntax.InternalSyntax.SyntaxList<Syntax.InternalSyntax.SwitchSectionSyntax>(), InternalSyntaxFactory.Token(SyntaxKind.CloseBraceToken));
443
=> InternalSyntaxFactory.SwitchExpression(GenerateIdentifierName(), InternalSyntaxFactory.Token(SyntaxKind.
SwitchKeyword
), InternalSyntaxFactory.Token(SyntaxKind.OpenBraceToken), new Microsoft.CodeAnalysis.Syntax.InternalSyntax.SeparatedSyntaxList<Syntax.InternalSyntax.SwitchExpressionArmSyntax>(), InternalSyntaxFactory.Token(SyntaxKind.CloseBraceToken));
2438
Assert.Equal(SyntaxKind.
SwitchKeyword
, node.SwitchKeyword.Kind);
2502
Assert.Equal(SyntaxKind.
SwitchKeyword
, node.SwitchKeyword.Kind);
10644
=> SyntaxFactory.SwitchStatement(new SyntaxList<AttributeListSyntax>(), SyntaxFactory.Token(SyntaxKind.
SwitchKeyword
), default(SyntaxToken), GenerateIdentifierName(), default(SyntaxToken), SyntaxFactory.Token(SyntaxKind.OpenBraceToken), new SyntaxList<SwitchSectionSyntax>(), SyntaxFactory.Token(SyntaxKind.CloseBraceToken));
10659
=> SyntaxFactory.SwitchExpression(GenerateIdentifierName(), SyntaxFactory.Token(SyntaxKind.
SwitchKeyword
), SyntaxFactory.Token(SyntaxKind.OpenBraceToken), new SeparatedSyntaxList<SwitchExpressionArmSyntax>(), SyntaxFactory.Token(SyntaxKind.CloseBraceToken));
12654
Assert.Equal(SyntaxKind.
SwitchKeyword
, node.SwitchKeyword.Kind());
12718
Assert.Equal(SyntaxKind.
SwitchKeyword
, node.SwitchKeyword.Kind());
Parsing\CollectionExpressionParsingTests.cs (3)
1277
N(SyntaxKind.
SwitchKeyword
);
1344
N(SyntaxKind.
SwitchKeyword
);
1435
N(SyntaxKind.
SwitchKeyword
);
Parsing\DeconstructionTests.cs (2)
2819
N(SyntaxKind.
SwitchKeyword
);
2887
N(SyntaxKind.
SwitchKeyword
);
Parsing\ExpressionParsingTests.cs (3)
3951
N(SyntaxKind.
SwitchKeyword
);
4617
N(SyntaxKind.
SwitchKeyword
);
4843
N(SyntaxKind.
SwitchKeyword
);
Parsing\FunctionPointerTests.cs (2)
2554
N(SyntaxKind.
SwitchKeyword
);
2678
N(SyntaxKind.
SwitchKeyword
);
Parsing\LambdaAttributeParsingTests.cs (5)
1690
N(SyntaxKind.
SwitchKeyword
);
1708
N(SyntaxKind.
SwitchKeyword
);
2005
N(SyntaxKind.
SwitchKeyword
);
2060
N(SyntaxKind.
SwitchKeyword
);
2119
N(SyntaxKind.
SwitchKeyword
);
Parsing\LambdaParameterParsingTests.cs (2)
3673
N(SyntaxKind.
SwitchKeyword
);
3925
N(SyntaxKind.
SwitchKeyword
);
Parsing\LambdaReturnTypeParsingTests.cs (7)
3453
N(SyntaxKind.
SwitchKeyword
);
3509
N(SyntaxKind.
SwitchKeyword
);
4284
N(SyntaxKind.
SwitchKeyword
);
4345
N(SyntaxKind.
SwitchKeyword
);
4413
N(SyntaxKind.
SwitchKeyword
);
4482
N(SyntaxKind.
SwitchKeyword
);
4580
N(SyntaxKind.
SwitchKeyword
);
Parsing\NullableParsingTests.cs (5)
694
N(SyntaxKind.
SwitchKeyword
);
756
N(SyntaxKind.
SwitchKeyword
);
843
N(SyntaxKind.
SwitchKeyword
);
899
N(SyntaxKind.
SwitchKeyword
);
958
N(SyntaxKind.
SwitchKeyword
);
Parsing\PatternParsingTests.cs (94)
808
N(SyntaxKind.
SwitchKeyword
);
942
N(SyntaxKind.
SwitchKeyword
);
1460
N(SyntaxKind.
SwitchKeyword
);
1512
N(SyntaxKind.
SwitchKeyword
);
1580
N(SyntaxKind.
SwitchKeyword
);
1623
N(SyntaxKind.
SwitchKeyword
);
1674
N(SyntaxKind.
SwitchKeyword
);
1735
N(SyntaxKind.
SwitchKeyword
);
1785
N(SyntaxKind.
SwitchKeyword
);
1874
N(SyntaxKind.
SwitchKeyword
);
1962
N(SyntaxKind.
SwitchKeyword
);
2047
N(SyntaxKind.
SwitchKeyword
);
2174
N(SyntaxKind.
SwitchKeyword
);
2247
N(SyntaxKind.
SwitchKeyword
);
2296
N(SyntaxKind.
SwitchKeyword
);
2342
N(SyntaxKind.
SwitchKeyword
);
2393
N(SyntaxKind.
SwitchKeyword
);
2468
N(SyntaxKind.
SwitchKeyword
);
2505
N(SyntaxKind.
SwitchKeyword
);
2579
N(SyntaxKind.
SwitchKeyword
);
2661
N(SyntaxKind.
SwitchKeyword
);
2751
N(SyntaxKind.
SwitchKeyword
);
2818
N(SyntaxKind.
SwitchKeyword
);
2888
N(SyntaxKind.
SwitchKeyword
);
2939
N(SyntaxKind.
SwitchKeyword
);
3876
N(SyntaxKind.
SwitchKeyword
);
3947
N(SyntaxKind.
SwitchKeyword
);
4020
N(SyntaxKind.
SwitchKeyword
);
4091
N(SyntaxKind.
SwitchKeyword
);
4164
N(SyntaxKind.
SwitchKeyword
);
4251
N(SyntaxKind.
SwitchKeyword
);
5427
N(SyntaxKind.
SwitchKeyword
);
5466
N(SyntaxKind.
SwitchKeyword
);
5491
N(SyntaxKind.
SwitchKeyword
);
5527
N(SyntaxKind.
SwitchKeyword
);
5563
N(SyntaxKind.
SwitchKeyword
);
5720
N(SyntaxKind.
SwitchKeyword
);
5964
N(SyntaxKind.
SwitchKeyword
);
6583
N(SyntaxKind.
SwitchKeyword
);
6707
N(SyntaxKind.
SwitchKeyword
);
6750
N(SyntaxKind.
SwitchKeyword
);
6980
N(SyntaxKind.
SwitchKeyword
);
7085
N(SyntaxKind.
SwitchKeyword
);
7202
N(SyntaxKind.
SwitchKeyword
);
7264
N(SyntaxKind.
SwitchKeyword
);
7329
N(SyntaxKind.
SwitchKeyword
);
7386
N(SyntaxKind.
SwitchKeyword
);
7454
N(SyntaxKind.
SwitchKeyword
);
7473
N(SyntaxKind.
SwitchKeyword
);
7514
N(SyntaxKind.
SwitchKeyword
);
7541
N(SyntaxKind.
SwitchKeyword
);
7581
N(SyntaxKind.
SwitchKeyword
);
7623
N(SyntaxKind.
SwitchKeyword
);
7663
N(SyntaxKind.
SwitchKeyword
);
7688
N(SyntaxKind.
SwitchKeyword
);
7710
N(SyntaxKind.
SwitchKeyword
);
7736
N(SyntaxKind.
SwitchKeyword
);
7766
N(SyntaxKind.
SwitchKeyword
);
7787
N(SyntaxKind.
SwitchKeyword
);
7807
N(SyntaxKind.
SwitchKeyword
);
7827
N(SyntaxKind.
SwitchKeyword
);
7847
N(SyntaxKind.
SwitchKeyword
);
7867
N(SyntaxKind.
SwitchKeyword
);
7891
N(SyntaxKind.
SwitchKeyword
);
7926
N(SyntaxKind.
SwitchKeyword
);
7974
N(SyntaxKind.
SwitchKeyword
);
8007
N(SyntaxKind.
SwitchKeyword
);
8048
N(SyntaxKind.
SwitchKeyword
);
8100
N(SyntaxKind.
SwitchKeyword
);
8532
N(SyntaxKind.
SwitchKeyword
);
8702
N(SyntaxKind.
SwitchKeyword
);
8876
N(SyntaxKind.
SwitchKeyword
);
9035
N(SyntaxKind.
SwitchKeyword
);
9311
N(SyntaxKind.
SwitchKeyword
);
9479
N(SyntaxKind.
SwitchKeyword
);
9537
N(SyntaxKind.
SwitchKeyword
);
9603
N(SyntaxKind.
SwitchKeyword
);
9665
N(SyntaxKind.
SwitchKeyword
);
11255
N(SyntaxKind.
SwitchKeyword
);
11309
N(SyntaxKind.
SwitchKeyword
);
11420
N(SyntaxKind.
SwitchKeyword
);
11743
N(SyntaxKind.
SwitchKeyword
);
12060
N(SyntaxKind.
SwitchKeyword
);
12141
N(SyntaxKind.
SwitchKeyword
);
12178
N(SyntaxKind.
SwitchKeyword
);
12236
N(SyntaxKind.
SwitchKeyword
);
12278
N(SyntaxKind.
SwitchKeyword
);
12342
N(SyntaxKind.
SwitchKeyword
);
12379
N(SyntaxKind.
SwitchKeyword
);
12437
N(SyntaxKind.
SwitchKeyword
);
12479
N(SyntaxKind.
SwitchKeyword
);
12542
N(SyntaxKind.
SwitchKeyword
);
12593
N(SyntaxKind.
SwitchKeyword
);
12644
N(SyntaxKind.
SwitchKeyword
);
Parsing\RecordParsing.cs (2)
1593
N(SyntaxKind.
SwitchKeyword
);
1798
N(SyntaxKind.
SwitchKeyword
);
Parsing\StatementAttributeParsingTests.cs (6)
2282
N(SyntaxKind.
SwitchKeyword
);
2350
N(SyntaxKind.
SwitchKeyword
);
2447
N(SyntaxKind.
SwitchKeyword
);
2471
M(SyntaxKind.
SwitchKeyword
);
2575
N(SyntaxKind.
SwitchKeyword
);
6259
N(SyntaxKind.
SwitchKeyword
);
Parsing\StatementParsingTests.cs (27)
2130
Assert.Equal(SyntaxKind.
SwitchKeyword
, ss.SwitchKeyword.Kind());
2153
Assert.Equal(SyntaxKind.
SwitchKeyword
, ss.SwitchKeyword.Kind());
2188
Assert.Equal(SyntaxKind.
SwitchKeyword
, ss.SwitchKeyword.Kind());
2235
Assert.Equal(SyntaxKind.
SwitchKeyword
, ss.SwitchKeyword.Kind());
2268
Assert.Equal(SyntaxKind.
SwitchKeyword
, ss.SwitchKeyword.Kind());
2310
Assert.Equal(SyntaxKind.
SwitchKeyword
, ss.SwitchKeyword.Kind());
3905
N(SyntaxKind.
SwitchKeyword
);
3936
N(SyntaxKind.
SwitchKeyword
);
3977
N(SyntaxKind.
SwitchKeyword
);
4030
N(SyntaxKind.
SwitchKeyword
);
4326
M(SyntaxKind.
SwitchKeyword
);
4463
N(SyntaxKind.
SwitchKeyword
);
4490
M(SyntaxKind.
SwitchKeyword
);
4627
N(SyntaxKind.
SwitchKeyword
);
4681
M(SyntaxKind.
SwitchKeyword
);
4788
N(SyntaxKind.
SwitchKeyword
);
4915
N(SyntaxKind.
SwitchKeyword
);
5048
N(SyntaxKind.
SwitchKeyword
);
5191
N(SyntaxKind.
SwitchKeyword
);
5258
N(SyntaxKind.
SwitchKeyword
);
5341
N(SyntaxKind.
SwitchKeyword
);
5436
N(SyntaxKind.
SwitchKeyword
);
5502
N(SyntaxKind.
SwitchKeyword
);
5558
N(SyntaxKind.
SwitchKeyword
);
5614
N(SyntaxKind.
SwitchKeyword
);
5680
N(SyntaxKind.
SwitchKeyword
);
5750
N(SyntaxKind.
SwitchKeyword
);
Parsing\SwitchExpressionParsingTests.cs (60)
39
N(SyntaxKind.
SwitchKeyword
);
106
N(SyntaxKind.
SwitchKeyword
);
173
N(SyntaxKind.
SwitchKeyword
);
246
N(SyntaxKind.
SwitchKeyword
);
344
N(SyntaxKind.
SwitchKeyword
);
388
M(SyntaxKind.
SwitchKeyword
);
522
N(SyntaxKind.
SwitchKeyword
);
607
N(SyntaxKind.
SwitchKeyword
);
696
N(SyntaxKind.
SwitchKeyword
);
779
N(SyntaxKind.
SwitchKeyword
);
858
N(SyntaxKind.
SwitchKeyword
);
946
N(SyntaxKind.
SwitchKeyword
);
1041
N(SyntaxKind.
SwitchKeyword
);
1123
N(SyntaxKind.
SwitchKeyword
);
1202
N(SyntaxKind.
SwitchKeyword
);
1296
N(SyntaxKind.
SwitchKeyword
);
1403
N(SyntaxKind.
SwitchKeyword
);
1498
N(SyntaxKind.
SwitchKeyword
);
1577
N(SyntaxKind.
SwitchKeyword
);
1660
N(SyntaxKind.
SwitchKeyword
);
1737
N(SyntaxKind.
SwitchKeyword
);
1811
N(SyntaxKind.
SwitchKeyword
);
1887
N(SyntaxKind.
SwitchKeyword
);
1963
N(SyntaxKind.
SwitchKeyword
);
2043
N(SyntaxKind.
SwitchKeyword
);
2129
N(SyntaxKind.
SwitchKeyword
);
2196
N(SyntaxKind.
SwitchKeyword
);
2263
N(SyntaxKind.
SwitchKeyword
);
2321
N(SyntaxKind.
SwitchKeyword
);
2385
N(SyntaxKind.
SwitchKeyword
);
2443
N(SyntaxKind.
SwitchKeyword
);
2513
N(SyntaxKind.
SwitchKeyword
);
2595
N(SyntaxKind.
SwitchKeyword
);
2688
N(SyntaxKind.
SwitchKeyword
);
2748
N(SyntaxKind.
SwitchKeyword
);
2816
N(SyntaxKind.
SwitchKeyword
);
2884
N(SyntaxKind.
SwitchKeyword
);
3007
N(SyntaxKind.
SwitchKeyword
);
3130
N(SyntaxKind.
SwitchKeyword
);
3259
N(SyntaxKind.
SwitchKeyword
);
3388
N(SyntaxKind.
SwitchKeyword
);
3553
N(SyntaxKind.
SwitchKeyword
);
3700
N(SyntaxKind.
SwitchKeyword
);
3763
N(SyntaxKind.
SwitchKeyword
);
3826
N(SyntaxKind.
SwitchKeyword
);
3905
N(SyntaxKind.
SwitchKeyword
);
3984
N(SyntaxKind.
SwitchKeyword
);
4079
N(SyntaxKind.
SwitchKeyword
);
4163
N(SyntaxKind.
SwitchKeyword
);
4251
N(SyntaxKind.
SwitchKeyword
);
4296
N(SyntaxKind.
SwitchKeyword
);
4350
N(SyntaxKind.
SwitchKeyword
);
4415
N(SyntaxKind.
SwitchKeyword
);
4466
N(SyntaxKind.
SwitchKeyword
);
4527
N(SyntaxKind.
SwitchKeyword
);
4585
N(SyntaxKind.
SwitchKeyword
);
4650
N(SyntaxKind.
SwitchKeyword
);
4712
N(SyntaxKind.
SwitchKeyword
);
4782
N(SyntaxKind.
SwitchKeyword
);
4849
N(SyntaxKind.
SwitchKeyword
);
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
Classification\ClassificationHelpers.cs (1)
85
case SyntaxKind.
SwitchKeyword
:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
88
public static readonly SyntaxToken SwitchKeyword = Token(SyntaxKind.
SwitchKeyword
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (1)
154
(previousKind == SyntaxKind.IfKeyword || previousKind == SyntaxKind.WhileKeyword || previousKind == SyntaxKind.
SwitchKeyword
||
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2645
token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.
SwitchKeyword
))
Microsoft.VisualStudio.LanguageServices.CSharp (1)
LanguageService\CSharpHelpContextService.cs (1)
508
if (token.IsKind(SyntaxKind.
SwitchKeyword
) && token.Parent is SwitchExpressionSyntax)