53 references to IfKeyword
Microsoft.CodeAnalysis.CSharp (24)
_generated\0\Syntax.xml.Main.Generated.cs (5)
4604if (ifKeyword.Kind() != SyntaxKind.IfKeyword) throw new ArgumentException(nameof(ifKeyword)); 4614=> SyntaxFactory.IfStatement(attributeLists, SyntaxFactory.Token(SyntaxKind.IfKeyword), SyntaxFactory.Token(SyntaxKind.OpenParenToken), condition, SyntaxFactory.Token(SyntaxKind.CloseParenToken), statement, @else); 4618=> SyntaxFactory.IfStatement(default, SyntaxFactory.Token(SyntaxKind.IfKeyword), SyntaxFactory.Token(SyntaxKind.OpenParenToken), condition, SyntaxFactory.Token(SyntaxKind.CloseParenToken), statement, default); 6371if (ifKeyword.Kind() != SyntaxKind.IfKeyword) throw new ArgumentException(nameof(ifKeyword)); 6379=> 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)
31653if (ifKeyword.Kind != SyntaxKind.IfKeyword) throw new ArgumentException(nameof(ifKeyword)); 33724if (ifKeyword.Kind != SyntaxKind.IfKeyword) throw new ArgumentException(nameof(ifKeyword)); 37075if (ifKeyword.Kind != SyntaxKind.IfKeyword) throw new ArgumentException(nameof(ifKeyword)); 39146if (ifKeyword.Kind != SyntaxKind.IfKeyword) throw new ArgumentException(nameof(ifKeyword));
Parser\DirectiveParser.cs (1)
53case SyntaxKind.IfKeyword:
Parser\LanguageParser.cs (9)
8385case SyntaxKind.IfKeyword: 9280case SyntaxKind.IfKeyword: 9518if (keywordKind == SyntaxKind.WhenKeyword || keywordKind == SyntaxKind.IfKeyword) 9521if (keywordKind == SyntaxKind.IfKeyword) 10079Debug.Assert(this.CurrentToken.Kind == SyntaxKind.IfKeyword); 10086var ifKeyword = this.EatToken(SyntaxKind.IfKeyword); 10103if (this.CurrentToken.Kind != SyntaxKind.IfKeyword) 10148this.EatToken(SyntaxKind.IfKeyword, ErrorCode.ERR_ElseCannotStartStatement), 11223case SyntaxKind.IfKeyword:
Syntax\SyntaxKindFacts.cs (4)
86case SyntaxKind.IfKeyword: 927return SyntaxKind.IfKeyword; 1192return SyntaxKind.IfKeyword; 1628case 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)
2639token.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)
2639token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.IfKeyword))
Microsoft.CodeAnalysis.Razor.Compiler (4)
Language\Legacy\CSharpCodeParser.cs (3)
91CSharpSyntaxKind.IfKeyword]; 2298Assert(CSharpSyntaxKind.IfKeyword); 2340if (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)
2639token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.IfKeyword))