45 references to WhenKeyword
Microsoft.CodeAnalysis.CSharp (9)
Parser\LanguageParser.cs (5)
9022if (keywordKind == SyntaxKind.WhenKeyword || keywordKind == SyntaxKind.IfKeyword) 9024var whenKeyword = this.EatContextualToken(SyntaxKind.WhenKeyword); 9792if (this.CurrentToken.ContextualKind == SyntaxKind.WhenKeyword && node is ExpressionSyntax ex) 10206if (this.CurrentToken.ContextualKind != SyntaxKind.WhenKeyword) 10212this.EatContextualToken(SyntaxKind.WhenKeyword),
Parser\LanguageParser_Patterns.cs (1)
390case SyntaxKind.WhenKeyword:
Syntax\SyntaxKindFacts.cs (3)
1216case SyntaxKind.WhenKeyword: 1327return SyntaxKind.WhenKeyword; 1769case SyntaxKind.WhenKeyword:
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (1)
156previousKind == SyntaxKind.UsingKeyword || previousKind == SyntaxKind.WhenKeyword || previousKind == SyntaxKind.LockKeyword ||
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (2)
2666token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.WhenKeyword)) 2672if (token.IsKind(SyntaxKind.WhenKeyword) && token.Parent.IsKind(SyntaxKind.WhenClause))
Microsoft.CodeAnalysis.CSharp.Features (1)
Completion\KeywordRecommenders\WhenKeywordRecommender.cs (1)
16: base(SyntaxKind.WhenKeyword, isValidInPreprocessorContext: true)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (28)
Generated\Syntax.Test.xml.Generated.cs (8)
275=> InternalSyntaxFactory.WhenClause(InternalSyntaxFactory.Token(SyntaxKind.WhenKeyword), GenerateIdentifierName()); 458=> InternalSyntaxFactory.CatchFilterClause(InternalSyntaxFactory.Token(SyntaxKind.WhenKeyword), InternalSyntaxFactory.Token(SyntaxKind.OpenParenToken), GenerateIdentifierName(), InternalSyntaxFactory.Token(SyntaxKind.CloseParenToken)); 1784Assert.Equal(SyntaxKind.WhenKeyword, node.WhenKeyword.Kind); 2568Assert.Equal(SyntaxKind.WhenKeyword, node.WhenKeyword.Kind); 10491=> SyntaxFactory.WhenClause(SyntaxFactory.Token(SyntaxKind.WhenKeyword), GenerateIdentifierName()); 10674=> SyntaxFactory.CatchFilterClause(SyntaxFactory.Token(SyntaxKind.WhenKeyword), SyntaxFactory.Token(SyntaxKind.OpenParenToken), GenerateIdentifierName(), SyntaxFactory.Token(SyntaxKind.CloseParenToken)); 12000Assert.Equal(SyntaxKind.WhenKeyword, node.WhenKeyword.Kind()); 12784Assert.Equal(SyntaxKind.WhenKeyword, node.WhenKeyword.Kind());
LexicalAndXml\SyntaxTokenParserTests.cs (1)
264AssertToken(expectedKind: SyntaxKind.IdentifierToken, expectedContextualKind: SyntaxKind.WhenKeyword, new TextSpan(0, 5), "when ", parser.ParseNextToken());
Parsing\ExpressionParsingTests.cs (1)
4873N(SyntaxKind.WhenKeyword);
Parsing\PatternParsingTests.cs (5)
1711N(SyntaxKind.WhenKeyword); 1822N(SyntaxKind.WhenKeyword); 2910N(SyntaxKind.WhenKeyword); 2961N(SyntaxKind.WhenKeyword); 5585N(SyntaxKind.WhenKeyword);
Parsing\StatementParsingTests.cs (7)
3468Assert.Equal(SyntaxKind.WhenKeyword, filterClause.WhenKeyword.Kind()); 4348N(SyntaxKind.WhenKeyword); 4512N(SyntaxKind.WhenKeyword); 4703N(SyntaxKind.WhenKeyword); 5640N(SyntaxKind.WhenKeyword); 5710N(SyntaxKind.WhenKeyword); 5785N(SyntaxKind.WhenKeyword);
Parsing\SwitchExpressionParsingTests.cs (6)
4483N(SyntaxKind.WhenKeyword); 4544N(SyntaxKind.WhenKeyword); 4606N(SyntaxKind.WhenKeyword); 4671N(SyntaxKind.WhenKeyword); 4738N(SyntaxKind.WhenKeyword); 4808N(SyntaxKind.WhenKeyword);
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
Classification\ClassificationHelpers.cs (1)
88case SyntaxKind.WhenKeyword: // Include WhenKeyword as it can be part of a CatchFilterClause or a pattern WhenClause
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (1)
156previousKind == SyntaxKind.UsingKeyword || previousKind == SyntaxKind.WhenKeyword || previousKind == SyntaxKind.LockKeyword ||
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (2)
2666token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.WhenKeyword)) 2672if (token.IsKind(SyntaxKind.WhenKeyword) && token.Parent.IsKind(SyntaxKind.WhenClause))