87 references to IfKeyword
Microsoft.CodeAnalysis.CSharp (15)
Parser\DirectiveParser.cs (1)
53
case SyntaxKind.
IfKeyword
:
Parser\LanguageParser.cs (9)
8003
case SyntaxKind.
IfKeyword
:
8823
case SyntaxKind.
IfKeyword
:
9040
if (keywordKind == SyntaxKind.WhenKeyword || keywordKind == SyntaxKind.
IfKeyword
)
9043
if (keywordKind == SyntaxKind.
IfKeyword
)
9568
Debug.Assert(this.CurrentToken.Kind == SyntaxKind.
IfKeyword
);
9575
var ifKeyword = this.EatToken(SyntaxKind.
IfKeyword
);
9592
if (this.CurrentToken.Kind != SyntaxKind.
IfKeyword
)
9637
this.EatToken(SyntaxKind.
IfKeyword
, ErrorCode.ERR_ElseCannotStartStatement),
10685
case SyntaxKind.
IfKeyword
:
Syntax\SyntaxKindFacts.cs (4)
86
case SyntaxKind.
IfKeyword
:
895
return SyntaxKind.
IfKeyword
;
1119
return SyntaxKind.
IfKeyword
;
1543
case SyntaxKind.
IfKeyword
:
Syntax\SyntaxNormalizer.cs (1)
268
return nextToken.Kind() != SyntaxKind.
IfKeyword
? 1 : 0;
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
40
public static readonly SyntaxToken IfKeyword = Token(SyntaxKind.
IfKeyword
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
362
return 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)
152
if (previousToken.Kind() == SyntaxKind.ElseKeyword && currentToken.Kind() != SyntaxKind.
IfKeyword
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
71
public int IfKeyword => (int)SyntaxKind.
IfKeyword
;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
326
if (targetToken.Kind() is SyntaxKind.
IfKeyword
or
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2638
token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.
IfKeyword
))
Microsoft.CodeAnalysis.CSharp.Features (3)
Completion\CompletionProviders\SnippetCompletionProvider.cs (1)
130
SyntaxKind.
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());
2411
Assert.Equal(SyntaxKind.
IfKeyword
, node.IfKeyword.Kind);
3596
Assert.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());
12627
Assert.Equal(SyntaxKind.
IfKeyword
, node.IfKeyword.Kind());
13812
Assert.Equal(SyntaxKind.
IfKeyword
, node.IfKeyword.Kind());
IncrementalParsing\IncrementalParsingTests.cs (2)
698
N(SyntaxKind.
IfKeyword
);
713
N(SyntaxKind.
IfKeyword
);
Parsing\DeclarationExpressionTests.cs (5)
67
N(SyntaxKind.
IfKeyword
);
101
N(SyntaxKind.
IfKeyword
);
145
N(SyntaxKind.
IfKeyword
);
187
N(SyntaxKind.
IfKeyword
);
230
N(SyntaxKind.
IfKeyword
);
Parsing\DeconstructionTests.cs (2)
2698
N(SyntaxKind.
IfKeyword
);
2760
N(SyntaxKind.
IfKeyword
);
Parsing\MemberDeclarationParsingTests.cs (1)
12485
N(SyntaxKind.
IfKeyword
);
Parsing\ParsingErrorRecoveryTests.cs (6)
5522
N(SyntaxKind.
IfKeyword
);
5635
N(SyntaxKind.
IfKeyword
);
8142
N(SyntaxKind.
IfKeyword
);
8192
N(SyntaxKind.
IfKeyword
);
8242
N(SyntaxKind.
IfKeyword
);
8296
N(SyntaxKind.
IfKeyword
);
Parsing\PatternParsingTests.cs (13)
2854
N(SyntaxKind.
IfKeyword
);
3062
N(SyntaxKind.
IfKeyword
);
3120
N(SyntaxKind.
IfKeyword
);
3180
N(SyntaxKind.
IfKeyword
);
3245
N(SyntaxKind.
IfKeyword
);
3312
N(SyntaxKind.
IfKeyword
);
3370
N(SyntaxKind.
IfKeyword
);
3430
N(SyntaxKind.
IfKeyword
);
3495
N(SyntaxKind.
IfKeyword
);
3562
N(SyntaxKind.
IfKeyword
);
3636
N(SyntaxKind.
IfKeyword
);
3712
N(SyntaxKind.
IfKeyword
);
3793
N(SyntaxKind.
IfKeyword
);
Parsing\StatementAttributeParsingTests.cs (2)
2206
N(SyntaxKind.
IfKeyword
);
3213
N(SyntaxKind.
IfKeyword
);
Parsing\StatementParsingTests.cs (11)
2024
Assert.Equal(SyntaxKind.
IfKeyword
, ss.IfKeyword.Kind());
2047
Assert.Equal(SyntaxKind.
IfKeyword
, ss.IfKeyword.Kind());
2073
Assert.Equal(SyntaxKind.
IfKeyword
, ss.IfKeyword.Kind());
2087
Assert.Equal(SyntaxKind.
IfKeyword
, subIf.IfKeyword.Kind());
3616
M(SyntaxKind.
IfKeyword
);
3691
M(SyntaxKind.
IfKeyword
);
3718
M(SyntaxKind.
IfKeyword
);
3777
N(SyntaxKind.
IfKeyword
);
3801
M(SyntaxKind.
IfKeyword
);
3857
N(SyntaxKind.
IfKeyword
);
3866
M(SyntaxKind.
IfKeyword
);
Syntax\SyntaxNodeTests.cs (3)
246
Assert.Equal(SyntaxKind.
IfKeyword
, nodesAndTokens[2].Kind());
283
Assert.Equal(SyntaxKind.
IfKeyword
, nodesAndTokens[3].Kind());
678
Assert.Equal(SyntaxKind.
IfKeyword
, token.Kind());
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
Classification\ClassificationHelpers.cs (1)
82
case SyntaxKind.
IfKeyword
:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
40
public static readonly SyntaxToken IfKeyword = Token(SyntaxKind.
IfKeyword
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
362
return 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)
152
if (previousToken.Kind() == SyntaxKind.ElseKeyword && currentToken.Kind() != SyntaxKind.
IfKeyword
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
71
public int IfKeyword => (int)SyntaxKind.
IfKeyword
;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
326
if (targetToken.Kind() is SyntaxKind.
IfKeyword
or
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2638
token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.
IfKeyword
))
Microsoft.CodeAnalysis.UnitTests (1)
CommonSyntaxTests.cs (1)
188
var token = CSharp.SyntaxFactory.Token(CSharp.SyntaxKind.
IfKeyword
);