87 references to IfKeyword
Microsoft.CodeAnalysis.CSharp (15)
Parser\DirectiveParser.cs (1)
53case SyntaxKind.IfKeyword:
Parser\LanguageParser.cs (9)
8003case SyntaxKind.IfKeyword: 8823case SyntaxKind.IfKeyword: 9040if (keywordKind == SyntaxKind.WhenKeyword || keywordKind == SyntaxKind.IfKeyword) 9043if (keywordKind == SyntaxKind.IfKeyword) 9568Debug.Assert(this.CurrentToken.Kind == SyntaxKind.IfKeyword); 9575var ifKeyword = this.EatToken(SyntaxKind.IfKeyword); 9592if (this.CurrentToken.Kind != SyntaxKind.IfKeyword) 9637this.EatToken(SyntaxKind.IfKeyword, ErrorCode.ERR_ElseCannotStartStatement), 10685case 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)
40public 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)
152if (previousToken.Kind() == SyntaxKind.ElseKeyword && currentToken.Kind() != SyntaxKind.IfKeyword)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
71public 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)
2638token.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 (53)
Generated\Syntax.Test.xml.Generated.cs (8)
422=> 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); 686=> InternalSyntaxFactory.IfDirectiveTrivia(InternalSyntaxFactory.Token(SyntaxKind.HashToken), InternalSyntaxFactory.Token(SyntaxKind.IfKeyword), GenerateIdentifierName(), InternalSyntaxFactory.Token(SyntaxKind.EndOfDirectiveToken), new bool(), new bool(), new bool()); 2411Assert.Equal(SyntaxKind.IfKeyword, node.IfKeyword.Kind); 3596Assert.Equal(SyntaxKind.IfKeyword, node.IfKeyword.Kind); 10638=> SyntaxFactory.IfStatement(new SyntaxList<AttributeListSyntax>(), SyntaxFactory.Token(SyntaxKind.IfKeyword), SyntaxFactory.Token(SyntaxKind.OpenParenToken), GenerateIdentifierName(), SyntaxFactory.Token(SyntaxKind.CloseParenToken), GenerateBlock(), default(ElseClauseSyntax)); 10902=> SyntaxFactory.IfDirectiveTrivia(SyntaxFactory.Token(SyntaxKind.HashToken), SyntaxFactory.Token(SyntaxKind.IfKeyword), GenerateIdentifierName(), SyntaxFactory.Token(SyntaxKind.EndOfDirectiveToken), new bool(), new bool(), new bool()); 12627Assert.Equal(SyntaxKind.IfKeyword, node.IfKeyword.Kind()); 13812Assert.Equal(SyntaxKind.IfKeyword, node.IfKeyword.Kind());
IncrementalParsing\IncrementalParsingTests.cs (2)
698N(SyntaxKind.IfKeyword); 713N(SyntaxKind.IfKeyword);
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)
12485N(SyntaxKind.IfKeyword);
Parsing\ParsingErrorRecoveryTests.cs (6)
5522N(SyntaxKind.IfKeyword); 5635N(SyntaxKind.IfKeyword); 8142N(SyntaxKind.IfKeyword); 8192N(SyntaxKind.IfKeyword); 8242N(SyntaxKind.IfKeyword); 8296N(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()); 678Assert.Equal(SyntaxKind.IfKeyword, token.Kind());
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
Classification\ClassificationHelpers.cs (1)
82case SyntaxKind.IfKeyword:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
40public 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)
152if (previousToken.Kind() == SyntaxKind.ElseKeyword && currentToken.Kind() != SyntaxKind.IfKeyword)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
71public 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)
2638token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.IfKeyword))
Microsoft.CodeAnalysis.UnitTests (1)
CommonSyntaxTests.cs (1)
188var token = CSharp.SyntaxFactory.Token(CSharp.SyntaxKind.IfKeyword);