53 references to IfKeyword
Microsoft.CodeAnalysis.CSharp (24)
_generated\0\Syntax.xml.Main.Generated.cs (5)
4566
if (ifKeyword.Kind() != SyntaxKind.
IfKeyword
) throw new ArgumentException(nameof(ifKeyword));
4576
=> SyntaxFactory.IfStatement(attributeLists, SyntaxFactory.Token(SyntaxKind.
IfKeyword
), SyntaxFactory.Token(SyntaxKind.OpenParenToken), condition, SyntaxFactory.Token(SyntaxKind.CloseParenToken), statement, @else);
4580
=> SyntaxFactory.IfStatement(default, SyntaxFactory.Token(SyntaxKind.
IfKeyword
), SyntaxFactory.Token(SyntaxKind.OpenParenToken), condition, SyntaxFactory.Token(SyntaxKind.CloseParenToken), statement, default);
6333
if (ifKeyword.Kind() != SyntaxKind.
IfKeyword
) throw new ArgumentException(nameof(ifKeyword));
6341
=> SyntaxFactory.IfDirectiveTrivia(SyntaxFactory.Token(SyntaxKind.HashToken), SyntaxFactory.Token(SyntaxKind.
IfKeyword
), condition, SyntaxFactory.Token(SyntaxKind.EndOfDirectiveToken), isActive, branchTaken, conditionValue);
_generated\1\Syntax.xml.Internal.Generated.cs (4)
31518
if (ifKeyword.Kind != SyntaxKind.
IfKeyword
) throw new ArgumentException(nameof(ifKeyword));
33589
if (ifKeyword.Kind != SyntaxKind.
IfKeyword
) throw new ArgumentException(nameof(ifKeyword));
36945
if (ifKeyword.Kind != SyntaxKind.
IfKeyword
) throw new ArgumentException(nameof(ifKeyword));
39016
if (ifKeyword.Kind != SyntaxKind.
IfKeyword
) throw new ArgumentException(nameof(ifKeyword));
Parser\DirectiveParser.cs (1)
53
case SyntaxKind.
IfKeyword
:
Parser\LanguageParser.cs (9)
8380
case SyntaxKind.
IfKeyword
:
9259
case SyntaxKind.
IfKeyword
:
9495
if (keywordKind == SyntaxKind.WhenKeyword || keywordKind == SyntaxKind.
IfKeyword
)
9498
if (keywordKind == SyntaxKind.
IfKeyword
)
10056
Debug.Assert(this.CurrentToken.Kind == SyntaxKind.
IfKeyword
);
10063
var ifKeyword = this.EatToken(SyntaxKind.
IfKeyword
);
10080
if (this.CurrentToken.Kind != SyntaxKind.
IfKeyword
)
10125
this.EatToken(SyntaxKind.
IfKeyword
, ErrorCode.ERR_ElseCannotStartStatement),
11199
case SyntaxKind.
IfKeyword
:
Syntax\SyntaxKindFacts.cs (4)
86
case SyntaxKind.
IfKeyword
:
925
return SyntaxKind.
IfKeyword
;
1190
return SyntaxKind.
IfKeyword
;
1626
case SyntaxKind.
IfKeyword
:
Syntax\SyntaxNormalizer.cs (1)
284
return nextToken.Kind() != SyntaxKind.
IfKeyword
? 1 : 0;
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
51
public static readonly SyntaxToken IfKeyword = Token(SyntaxKind.
IfKeyword
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
362
return currentToken.Kind() != SyntaxKind.
IfKeyword
? 1 : 0;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (1)
154
(previousKind == SyntaxKind.
IfKeyword
|| previousKind == SyntaxKind.WhileKeyword || previousKind == SyntaxKind.SwitchKeyword ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (1)
146
var isElseIfOnSameLine = currentToken.Kind() == SyntaxKind.
IfKeyword
&& FormattingHelpers.AreOnSameLine(previousToken, currentToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
72
public int IfKeyword => (int)SyntaxKind.
IfKeyword
;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
326
if (targetToken.Kind() is SyntaxKind.
IfKeyword
or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2646
token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.
IfKeyword
))
Microsoft.CodeAnalysis.CSharp.Features (3)
Completion\CompletionProviders\SnippetCompletionProvider.cs (1)
127
SyntaxKind.
IfKeyword
or
Completion\KeywordRecommenders\IfKeywordRecommender.cs (1)
10
internal sealed class IfKeywordRecommender() : AbstractSyntacticSingleKeywordRecommender(SyntaxKind.
IfKeyword
, isValidInPreprocessorContext: true)
Highlighting\KeywordHighlighters\IfStatementHighlighter.cs (1)
29
=> tokens.Any(static t => t.Kind() is SyntaxKind.
IfKeyword
or SyntaxKind.ElseKeyword);
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
Classification\ClassificationHelpers.cs (1)
84
case SyntaxKind.
IfKeyword
:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
51
public static readonly SyntaxToken IfKeyword = Token(SyntaxKind.
IfKeyword
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
362
return currentToken.Kind() != SyntaxKind.
IfKeyword
? 1 : 0;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (1)
154
(previousKind == SyntaxKind.
IfKeyword
|| previousKind == SyntaxKind.WhileKeyword || previousKind == SyntaxKind.SwitchKeyword ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (1)
146
var isElseIfOnSameLine = currentToken.Kind() == SyntaxKind.
IfKeyword
&& FormattingHelpers.AreOnSameLine(previousToken, currentToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
72
public int IfKeyword => (int)SyntaxKind.
IfKeyword
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
326
if (targetToken.Kind() is SyntaxKind.
IfKeyword
or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2646
token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.
IfKeyword
))
Microsoft.CodeAnalysis.Razor.Compiler (4)
Language\Legacy\CSharpCodeParser.cs (3)
91
CSharpSyntaxKind.
IfKeyword
];
2282
Assert(CSharpSyntaxKind.
IfKeyword
);
2324
if (At(CSharpSyntaxKind.
IfKeyword
))
Language\Legacy\NativeCSharpTokenizer.cs (1)
34
CSharpSyntaxKind.
IfKeyword
,
Roslyn.Diagnostics.CSharp.Analyzers (7)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
51
public static readonly SyntaxToken IfKeyword = Token(SyntaxKind.
IfKeyword
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
362
return currentToken.Kind() != SyntaxKind.
IfKeyword
? 1 : 0;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (1)
154
(previousKind == SyntaxKind.
IfKeyword
|| previousKind == SyntaxKind.WhileKeyword || previousKind == SyntaxKind.SwitchKeyword ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (1)
146
var isElseIfOnSameLine = currentToken.Kind() == SyntaxKind.
IfKeyword
&& FormattingHelpers.AreOnSameLine(previousToken, currentToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
72
public int IfKeyword => (int)SyntaxKind.
IfKeyword
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
326
if (targetToken.Kind() is SyntaxKind.
IfKeyword
or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2646
token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.
IfKeyword
))