80 references to IfKeyword
Microsoft.CodeAnalysis.CSharp (14)
Parser\DirectiveParser.cs (1)
58case SyntaxKind.IfKeyword:
Parser\LanguageParser.cs (8)
7978case SyntaxKind.IfKeyword: 8793case SyntaxKind.IfKeyword: 9010if (keywordKind == SyntaxKind.WhenKeyword || keywordKind == SyntaxKind.IfKeyword) 9013if (keywordKind == SyntaxKind.IfKeyword) 9538Debug.Assert(this.CurrentToken.Kind == SyntaxKind.IfKeyword); 9542this.EatToken(SyntaxKind.IfKeyword), 9556this.EatToken(SyntaxKind.IfKeyword, ErrorCode.ERR_ElseCannotStartStatement), 10590case SyntaxKind.IfKeyword:
Syntax\SyntaxKindFacts.cs (4)
86case SyntaxKind.IfKeyword: 895return SyntaxKind.IfKeyword; 1119return SyntaxKind.IfKeyword; 1543case SyntaxKind.IfKeyword:
Syntax\SyntaxNormalizer.cs (1)
268return nextToken.Kind() != SyntaxKind.IfKeyword ? 1 : 0;
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
39public static readonly SyntaxToken IfKeyword = Token(SyntaxKind.IfKeyword);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
362return currentToken.Kind() != SyntaxKind.IfKeyword ? 1 : 0;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (1)
154(previousKind == SyntaxKind.IfKeyword || previousKind == SyntaxKind.WhileKeyword || previousKind == SyntaxKind.SwitchKeyword ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (1)
151if (previousToken.Kind() == SyntaxKind.ElseKeyword && currentToken.Kind() != SyntaxKind.IfKeyword)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
69public int IfKeyword => (int)SyntaxKind.IfKeyword;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
326if (targetToken.Kind() is SyntaxKind.IfKeyword or
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2632token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.IfKeyword))
Microsoft.CodeAnalysis.CSharp.Features (3)
Completion\CompletionProviders\SnippetCompletionProvider.cs (1)
130SyntaxKind.IfKeyword or
Completion\KeywordRecommenders\IfKeywordRecommender.cs (1)
13: base(SyntaxKind.IfKeyword, isValidInPreprocessorContext: true)
Highlighting\KeywordHighlighters\IfStatementHighlighter.cs (1)
28=> tokens.Any(static t => t.Kind() is SyntaxKind.IfKeyword or SyntaxKind.ElseKeyword);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (47)
Generated\Syntax.Test.xml.Generated.cs (8)
419=> InternalSyntaxFactory.IfStatement(new Microsoft.CodeAnalysis.Syntax.InternalSyntax.SyntaxList<Syntax.InternalSyntax.AttributeListSyntax>(), InternalSyntaxFactory.Token(SyntaxKind.IfKeyword), InternalSyntaxFactory.Token(SyntaxKind.OpenParenToken), GenerateIdentifierName(), InternalSyntaxFactory.Token(SyntaxKind.CloseParenToken), GenerateBlock(), null); 683=> InternalSyntaxFactory.IfDirectiveTrivia(InternalSyntaxFactory.Token(SyntaxKind.HashToken), InternalSyntaxFactory.Token(SyntaxKind.IfKeyword), GenerateIdentifierName(), InternalSyntaxFactory.Token(SyntaxKind.EndOfDirectiveToken), new bool(), new bool(), new bool()); 2398Assert.Equal(SyntaxKind.IfKeyword, node.IfKeyword.Kind); 3583Assert.Equal(SyntaxKind.IfKeyword, node.IfKeyword.Kind); 10596=> SyntaxFactory.IfStatement(new SyntaxList<AttributeListSyntax>(), SyntaxFactory.Token(SyntaxKind.IfKeyword), SyntaxFactory.Token(SyntaxKind.OpenParenToken), GenerateIdentifierName(), SyntaxFactory.Token(SyntaxKind.CloseParenToken), GenerateBlock(), default(ElseClauseSyntax)); 10860=> SyntaxFactory.IfDirectiveTrivia(SyntaxFactory.Token(SyntaxKind.HashToken), SyntaxFactory.Token(SyntaxKind.IfKeyword), GenerateIdentifierName(), SyntaxFactory.Token(SyntaxKind.EndOfDirectiveToken), new bool(), new bool(), new bool()); 12575Assert.Equal(SyntaxKind.IfKeyword, node.IfKeyword.Kind()); 13760Assert.Equal(SyntaxKind.IfKeyword, node.IfKeyword.Kind());
Parsing\DeclarationExpressionTests.cs (5)
67N(SyntaxKind.IfKeyword); 101N(SyntaxKind.IfKeyword); 145N(SyntaxKind.IfKeyword); 187N(SyntaxKind.IfKeyword); 230N(SyntaxKind.IfKeyword);
Parsing\DeconstructionTests.cs (2)
2698N(SyntaxKind.IfKeyword); 2760N(SyntaxKind.IfKeyword);
Parsing\MemberDeclarationParsingTests.cs (1)
12490N(SyntaxKind.IfKeyword);
Parsing\ParsingErrorRecoveryTests.cs (2)
5522N(SyntaxKind.IfKeyword); 5635N(SyntaxKind.IfKeyword);
Parsing\PatternParsingTests.cs (13)
2854N(SyntaxKind.IfKeyword); 3062N(SyntaxKind.IfKeyword); 3120N(SyntaxKind.IfKeyword); 3180N(SyntaxKind.IfKeyword); 3245N(SyntaxKind.IfKeyword); 3312N(SyntaxKind.IfKeyword); 3370N(SyntaxKind.IfKeyword); 3430N(SyntaxKind.IfKeyword); 3495N(SyntaxKind.IfKeyword); 3562N(SyntaxKind.IfKeyword); 3636N(SyntaxKind.IfKeyword); 3712N(SyntaxKind.IfKeyword); 3793N(SyntaxKind.IfKeyword);
Parsing\StatementAttributeParsingTests.cs (2)
2206N(SyntaxKind.IfKeyword); 3213N(SyntaxKind.IfKeyword);
Parsing\StatementParsingTests.cs (11)
2024Assert.Equal(SyntaxKind.IfKeyword, ss.IfKeyword.Kind()); 2047Assert.Equal(SyntaxKind.IfKeyword, ss.IfKeyword.Kind()); 2073Assert.Equal(SyntaxKind.IfKeyword, ss.IfKeyword.Kind()); 2087Assert.Equal(SyntaxKind.IfKeyword, subIf.IfKeyword.Kind()); 3616M(SyntaxKind.IfKeyword); 3691M(SyntaxKind.IfKeyword); 3718M(SyntaxKind.IfKeyword); 3777N(SyntaxKind.IfKeyword); 3801M(SyntaxKind.IfKeyword); 3857N(SyntaxKind.IfKeyword); 3866M(SyntaxKind.IfKeyword);
Syntax\SyntaxNodeTests.cs (3)
246Assert.Equal(SyntaxKind.IfKeyword, nodesAndTokens[2].Kind()); 283Assert.Equal(SyntaxKind.IfKeyword, nodesAndTokens[3].Kind()); 655Assert.Equal(SyntaxKind.IfKeyword, token.Kind());
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
Classification\ClassificationHelpers.cs (1)
75case SyntaxKind.IfKeyword:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
39public static readonly SyntaxToken IfKeyword = Token(SyntaxKind.IfKeyword);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
362return currentToken.Kind() != SyntaxKind.IfKeyword ? 1 : 0;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (1)
154(previousKind == SyntaxKind.IfKeyword || previousKind == SyntaxKind.WhileKeyword || previousKind == SyntaxKind.SwitchKeyword ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (1)
151if (previousToken.Kind() == SyntaxKind.ElseKeyword && currentToken.Kind() != SyntaxKind.IfKeyword)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
69public int IfKeyword => (int)SyntaxKind.IfKeyword;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
326if (targetToken.Kind() is SyntaxKind.IfKeyword or
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2632token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.IfKeyword))
Microsoft.CodeAnalysis.UnitTests (1)
CommonSyntaxTests.cs (1)
188var token = CSharp.SyntaxFactory.Token(CSharp.SyntaxKind.IfKeyword);