191 references to SwitchKeyword
Microsoft.CodeAnalysis.CSharp (13)
Parser\LanguageParser.cs (8)
7412
case SyntaxKind.
SwitchKeyword
:
8221
case SyntaxKind.
SwitchKeyword
:
9066
Debug.Assert(this.CurrentToken.Kind is SyntaxKind.
SwitchKeyword
or SyntaxKind.CaseKeyword);
9095
switchKeyword = EatToken(SyntaxKind.
SwitchKeyword
);
9103
switchKeyword = this.EatToken(SyntaxKind.
SwitchKeyword
);
10008
case SyntaxKind.
SwitchKeyword
:
10396
else if (tk == SyntaxKind.
SwitchKeyword
&& this.PeekToken(1).Kind == SyntaxKind.OpenBraceToken)
11831
case SyntaxKind.
SwitchKeyword
:
Syntax\SyntaxFactory.cs (1)
2716
SyntaxFactory.Token(SyntaxKind.
SwitchKeyword
),
Syntax\SyntaxKindFacts.cs (2)
879
return SyntaxKind.
SwitchKeyword
;
1519
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 (1)
SpacingFormattingRule.cs (1)
156
(previousKind == SyntaxKind.IfKeyword || previousKind == SyntaxKind.WhileKeyword || previousKind == SyntaxKind.
SwitchKeyword
||
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
250
Token(leading: default, SyntaxKind.
SwitchKeyword
, node.CloseParenToken.TrailingTrivia),
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
2659
token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.
SwitchKeyword
))
Microsoft.CodeAnalysis.CSharp.Features (3)
Completion\KeywordRecommenders\SwitchKeywordRecommender.cs (1)
13
: base(SyntaxKind.
SwitchKeyword
)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (1)
72
switchKeyword: Token(SyntaxKind.
SwitchKeyword
).WithTriviaFrom(ifStatement.IfKeyword),
ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
250
Token(leading: default, SyntaxKind.
SwitchKeyword
, node.CloseParenToken.TrailingTrivia),
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (167)
Generated\Syntax.Test.xml.Generated.cs (8)
416
=> 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));
431
=> InternalSyntaxFactory.SwitchExpression(GenerateIdentifierName(), InternalSyntaxFactory.Token(SyntaxKind.
SwitchKeyword
), InternalSyntaxFactory.Token(SyntaxKind.OpenBraceToken), new Microsoft.CodeAnalysis.Syntax.InternalSyntax.SeparatedSyntaxList<Syntax.InternalSyntax.SwitchExpressionArmSyntax>(), InternalSyntaxFactory.Token(SyntaxKind.CloseBraceToken));
2377
Assert.Equal(SyntaxKind.
SwitchKeyword
, node.SwitchKeyword.Kind);
2441
Assert.Equal(SyntaxKind.
SwitchKeyword
, node.SwitchKeyword.Kind);
10392
=> 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));
10407
=> SyntaxFactory.SwitchExpression(GenerateIdentifierName(), SyntaxFactory.Token(SyntaxKind.
SwitchKeyword
), SyntaxFactory.Token(SyntaxKind.OpenBraceToken), new SeparatedSyntaxList<SwitchExpressionArmSyntax>(), SyntaxFactory.Token(SyntaxKind.CloseBraceToken));
12353
Assert.Equal(SyntaxKind.
SwitchKeyword
, node.SwitchKeyword.Kind());
12417
Assert.Equal(SyntaxKind.
SwitchKeyword
, node.SwitchKeyword.Kind());
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)
1695
N(SyntaxKind.
SwitchKeyword
);
1713
N(SyntaxKind.
SwitchKeyword
);
2020
N(SyntaxKind.
SwitchKeyword
);
2075
N(SyntaxKind.
SwitchKeyword
);
2134
N(SyntaxKind.
SwitchKeyword
);
Parsing\LambdaParameterParsingTests.cs (2)
3585
N(SyntaxKind.
SwitchKeyword
);
3837
N(SyntaxKind.
SwitchKeyword
);
Parsing\LambdaReturnTypeParsingTests.cs (7)
3380
N(SyntaxKind.
SwitchKeyword
);
3436
N(SyntaxKind.
SwitchKeyword
);
4211
N(SyntaxKind.
SwitchKeyword
);
4272
N(SyntaxKind.
SwitchKeyword
);
4340
N(SyntaxKind.
SwitchKeyword
);
4409
N(SyntaxKind.
SwitchKeyword
);
4507
N(SyntaxKind.
SwitchKeyword
);
Parsing\NullableParsingTests.cs (5)
693
N(SyntaxKind.
SwitchKeyword
);
755
N(SyntaxKind.
SwitchKeyword
);
841
N(SyntaxKind.
SwitchKeyword
);
897
N(SyntaxKind.
SwitchKeyword
);
956
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
);
2186
N(SyntaxKind.
SwitchKeyword
);
2259
N(SyntaxKind.
SwitchKeyword
);
2308
N(SyntaxKind.
SwitchKeyword
);
2354
N(SyntaxKind.
SwitchKeyword
);
2405
N(SyntaxKind.
SwitchKeyword
);
2480
N(SyntaxKind.
SwitchKeyword
);
2517
N(SyntaxKind.
SwitchKeyword
);
2591
N(SyntaxKind.
SwitchKeyword
);
2673
N(SyntaxKind.
SwitchKeyword
);
2784
N(SyntaxKind.
SwitchKeyword
);
2857
N(SyntaxKind.
SwitchKeyword
);
2927
N(SyntaxKind.
SwitchKeyword
);
2978
N(SyntaxKind.
SwitchKeyword
);
3915
N(SyntaxKind.
SwitchKeyword
);
3986
N(SyntaxKind.
SwitchKeyword
);
4059
N(SyntaxKind.
SwitchKeyword
);
4130
N(SyntaxKind.
SwitchKeyword
);
4203
N(SyntaxKind.
SwitchKeyword
);
4290
N(SyntaxKind.
SwitchKeyword
);
5466
N(SyntaxKind.
SwitchKeyword
);
5505
N(SyntaxKind.
SwitchKeyword
);
5530
N(SyntaxKind.
SwitchKeyword
);
5566
N(SyntaxKind.
SwitchKeyword
);
5602
N(SyntaxKind.
SwitchKeyword
);
5759
N(SyntaxKind.
SwitchKeyword
);
6003
N(SyntaxKind.
SwitchKeyword
);
6622
N(SyntaxKind.
SwitchKeyword
);
6746
N(SyntaxKind.
SwitchKeyword
);
6789
N(SyntaxKind.
SwitchKeyword
);
7019
N(SyntaxKind.
SwitchKeyword
);
7124
N(SyntaxKind.
SwitchKeyword
);
7241
N(SyntaxKind.
SwitchKeyword
);
7303
N(SyntaxKind.
SwitchKeyword
);
7368
N(SyntaxKind.
SwitchKeyword
);
7425
N(SyntaxKind.
SwitchKeyword
);
7493
N(SyntaxKind.
SwitchKeyword
);
7512
N(SyntaxKind.
SwitchKeyword
);
7553
N(SyntaxKind.
SwitchKeyword
);
7580
N(SyntaxKind.
SwitchKeyword
);
7620
N(SyntaxKind.
SwitchKeyword
);
7662
N(SyntaxKind.
SwitchKeyword
);
7702
N(SyntaxKind.
SwitchKeyword
);
7727
N(SyntaxKind.
SwitchKeyword
);
7749
N(SyntaxKind.
SwitchKeyword
);
7775
N(SyntaxKind.
SwitchKeyword
);
7805
N(SyntaxKind.
SwitchKeyword
);
7826
N(SyntaxKind.
SwitchKeyword
);
7846
N(SyntaxKind.
SwitchKeyword
);
7866
N(SyntaxKind.
SwitchKeyword
);
7886
N(SyntaxKind.
SwitchKeyword
);
7906
N(SyntaxKind.
SwitchKeyword
);
7930
N(SyntaxKind.
SwitchKeyword
);
7965
N(SyntaxKind.
SwitchKeyword
);
8013
N(SyntaxKind.
SwitchKeyword
);
8046
N(SyntaxKind.
SwitchKeyword
);
8087
N(SyntaxKind.
SwitchKeyword
);
8139
N(SyntaxKind.
SwitchKeyword
);
8571
N(SyntaxKind.
SwitchKeyword
);
8741
N(SyntaxKind.
SwitchKeyword
);
8915
N(SyntaxKind.
SwitchKeyword
);
9074
N(SyntaxKind.
SwitchKeyword
);
9350
N(SyntaxKind.
SwitchKeyword
);
9518
N(SyntaxKind.
SwitchKeyword
);
9576
N(SyntaxKind.
SwitchKeyword
);
9642
N(SyntaxKind.
SwitchKeyword
);
9704
N(SyntaxKind.
SwitchKeyword
);
11294
N(SyntaxKind.
SwitchKeyword
);
11348
N(SyntaxKind.
SwitchKeyword
);
11459
N(SyntaxKind.
SwitchKeyword
);
11782
N(SyntaxKind.
SwitchKeyword
);
12099
N(SyntaxKind.
SwitchKeyword
);
12180
N(SyntaxKind.
SwitchKeyword
);
12217
N(SyntaxKind.
SwitchKeyword
);
12275
N(SyntaxKind.
SwitchKeyword
);
12317
N(SyntaxKind.
SwitchKeyword
);
12381
N(SyntaxKind.
SwitchKeyword
);
12418
N(SyntaxKind.
SwitchKeyword
);
12476
N(SyntaxKind.
SwitchKeyword
);
12518
N(SyntaxKind.
SwitchKeyword
);
12581
N(SyntaxKind.
SwitchKeyword
);
12632
N(SyntaxKind.
SwitchKeyword
);
12683
N(SyntaxKind.
SwitchKeyword
);
Parsing\RecordParsing.cs (2)
1593
N(SyntaxKind.
SwitchKeyword
);
1798
N(SyntaxKind.
SwitchKeyword
);
Parsing\StatementAttributeParsingTests.cs (6)
2281
N(SyntaxKind.
SwitchKeyword
);
2349
N(SyntaxKind.
SwitchKeyword
);
2446
N(SyntaxKind.
SwitchKeyword
);
2470
M(SyntaxKind.
SwitchKeyword
);
2574
N(SyntaxKind.
SwitchKeyword
);
6247
N(SyntaxKind.
SwitchKeyword
);
Parsing\StatementParsingTests.cs (15)
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());
3904
N(SyntaxKind.
SwitchKeyword
);
3935
N(SyntaxKind.
SwitchKeyword
);
3976
N(SyntaxKind.
SwitchKeyword
);
4029
N(SyntaxKind.
SwitchKeyword
);
4298
M(SyntaxKind.
SwitchKeyword
);
4435
N(SyntaxKind.
SwitchKeyword
);
4462
M(SyntaxKind.
SwitchKeyword
);
4599
N(SyntaxKind.
SwitchKeyword
);
4653
M(SyntaxKind.
SwitchKeyword
);
Parsing\SwitchExpressionParsingTests.cs (16)
38
N(SyntaxKind.
SwitchKeyword
);
105
N(SyntaxKind.
SwitchKeyword
);
172
N(SyntaxKind.
SwitchKeyword
);
245
N(SyntaxKind.
SwitchKeyword
);
343
N(SyntaxKind.
SwitchKeyword
);
387
M(SyntaxKind.
SwitchKeyword
);
479
N(SyntaxKind.
SwitchKeyword
);
546
N(SyntaxKind.
SwitchKeyword
);
604
N(SyntaxKind.
SwitchKeyword
);
668
N(SyntaxKind.
SwitchKeyword
);
726
N(SyntaxKind.
SwitchKeyword
);
796
N(SyntaxKind.
SwitchKeyword
);
878
N(SyntaxKind.
SwitchKeyword
);
971
N(SyntaxKind.
SwitchKeyword
);
1031
N(SyntaxKind.
SwitchKeyword
);
1101
N(SyntaxKind.
SwitchKeyword
);
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
Classification\ClassificationHelpers.cs (1)
81
case SyntaxKind.
SwitchKeyword
:
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3549
SyntaxFactory.Token(SyntaxKind.
SwitchKeyword
),
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
2659
token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.
SwitchKeyword
))
SpacingFormattingRule.cs (1)
156
(previousKind == SyntaxKind.IfKeyword || previousKind == SyntaxKind.WhileKeyword || previousKind == SyntaxKind.
SwitchKeyword
||
Microsoft.VisualStudio.LanguageServices.CSharp (1)
LanguageService\CSharpHelpContextService.cs (1)
501
if (token.IsKind(SyntaxKind.
SwitchKeyword
) && token.Parent is SwitchExpressionSyntax)