53 references to IfKeyword
Microsoft.CodeAnalysis.CSharp (24)
_generated\0\Syntax.xml.Main.Generated.cs (5)
4566if (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); 6333if (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)
31518if (ifKeyword.Kind != SyntaxKind.IfKeyword) throw new ArgumentException(nameof(ifKeyword)); 33589if (ifKeyword.Kind != SyntaxKind.IfKeyword) throw new ArgumentException(nameof(ifKeyword)); 36945if (ifKeyword.Kind != SyntaxKind.IfKeyword) throw new ArgumentException(nameof(ifKeyword)); 39016if (ifKeyword.Kind != SyntaxKind.IfKeyword) throw new ArgumentException(nameof(ifKeyword));
Parser\DirectiveParser.cs (1)
53case SyntaxKind.IfKeyword:
Parser\LanguageParser.cs (9)
8380case SyntaxKind.IfKeyword: 9259case SyntaxKind.IfKeyword: 9495if (keywordKind == SyntaxKind.WhenKeyword || keywordKind == SyntaxKind.IfKeyword) 9498if (keywordKind == SyntaxKind.IfKeyword) 10056Debug.Assert(this.CurrentToken.Kind == SyntaxKind.IfKeyword); 10063var ifKeyword = this.EatToken(SyntaxKind.IfKeyword); 10080if (this.CurrentToken.Kind != SyntaxKind.IfKeyword) 10125this.EatToken(SyntaxKind.IfKeyword, ErrorCode.ERR_ElseCannotStartStatement), 11199case SyntaxKind.IfKeyword:
Syntax\SyntaxKindFacts.cs (4)
86case SyntaxKind.IfKeyword: 925return SyntaxKind.IfKeyword; 1190return SyntaxKind.IfKeyword; 1626case SyntaxKind.IfKeyword:
Syntax\SyntaxNormalizer.cs (1)
284return nextToken.Kind() != SyntaxKind.IfKeyword ? 1 : 0;
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
51public static readonly SyntaxToken IfKeyword = Token(SyntaxKind.IfKeyword);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
362return 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)
146var isElseIfOnSameLine = currentToken.Kind() == SyntaxKind.IfKeyword && FormattingHelpers.AreOnSameLine(previousToken, currentToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
72public int IfKeyword => (int)SyntaxKind.IfKeyword;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
326if (targetToken.Kind() is SyntaxKind.IfKeyword or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2646token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.IfKeyword))
Microsoft.CodeAnalysis.CSharp.Features (3)
Completion\CompletionProviders\SnippetCompletionProvider.cs (1)
127SyntaxKind.IfKeyword or
Completion\KeywordRecommenders\IfKeywordRecommender.cs (1)
10internal 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)
84case SyntaxKind.IfKeyword:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
51public static readonly SyntaxToken IfKeyword = Token(SyntaxKind.IfKeyword);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
362return 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)
146var isElseIfOnSameLine = currentToken.Kind() == SyntaxKind.IfKeyword && FormattingHelpers.AreOnSameLine(previousToken, currentToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
72public int IfKeyword => (int)SyntaxKind.IfKeyword;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
326if (targetToken.Kind() is SyntaxKind.IfKeyword or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2646token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.IfKeyword))
Microsoft.CodeAnalysis.Razor.Compiler (4)
Language\Legacy\CSharpCodeParser.cs (3)
91CSharpSyntaxKind.IfKeyword]; 2282Assert(CSharpSyntaxKind.IfKeyword); 2324if (At(CSharpSyntaxKind.IfKeyword))
Language\Legacy\NativeCSharpTokenizer.cs (1)
34CSharpSyntaxKind.IfKeyword,
Roslyn.Diagnostics.CSharp.Analyzers (7)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeGeneration\CSharpSyntaxTokens.cs (1)
51public static readonly SyntaxToken IfKeyword = Token(SyntaxKind.IfKeyword);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
362return 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)
146var isElseIfOnSameLine = currentToken.Kind() == SyntaxKind.IfKeyword && FormattingHelpers.AreOnSameLine(previousToken, currentToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
72public int IfKeyword => (int)SyntaxKind.IfKeyword;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
326if (targetToken.Kind() is SyntaxKind.IfKeyword or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2646token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.IfKeyword))