76 references to IfKeyword
Microsoft.CodeAnalysis.CSharp (14)
Parser\DirectiveParser.cs (1)
55case SyntaxKind.IfKeyword:
Parser\LanguageParser.cs (8)
7403case SyntaxKind.IfKeyword: 8217case SyntaxKind.IfKeyword: 8442if (keywordKind == SyntaxKind.WhenKeyword || keywordKind == SyntaxKind.IfKeyword) 8445if (keywordKind == SyntaxKind.IfKeyword) 8970Debug.Assert(this.CurrentToken.Kind == SyntaxKind.IfKeyword); 8974this.EatToken(SyntaxKind.IfKeyword), 8988this.EatToken(SyntaxKind.IfKeyword, ErrorCode.ERR_ElseCannotStartStatement), 10004case SyntaxKind.IfKeyword:
Syntax\SyntaxKindFacts.cs (4)
75case SyntaxKind.IfKeyword: 867return SyntaxKind.IfKeyword; 1091return SyntaxKind.IfKeyword; 1507case SyntaxKind.IfKeyword:
Syntax\SyntaxNormalizer.cs (1)
268return nextToken.Kind() != SyntaxKind.IfKeyword ? 1 : 0;
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
66SyntaxKind.IfKeyword or
CSharpSyntaxKinds.cs (1)
61public int IfKeyword => (int)SyntaxKind.IfKeyword;
ElasticTriviaFormattingRule.cs (1)
349return currentToken.Kind() != SyntaxKind.IfKeyword ? 1 : 0;
SpacingFormattingRule.cs (1)
156(previousKind == SyntaxKind.IfKeyword || previousKind == SyntaxKind.WhileKeyword || previousKind == SyntaxKind.SwitchKeyword ||
TokenBasedFormattingRule.cs (1)
149if (previousToken.Kind() == SyntaxKind.ElseKeyword && currentToken.Kind() != SyntaxKind.IfKeyword)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (1)
325if (targetToken.Kind() is SyntaxKind.IfKeyword or
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
2652token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.IfKeyword))
Microsoft.CodeAnalysis.CSharp.Features (4)
Completion\CompletionProviders\SnippetCompletionProvider.cs (1)
113SyntaxKind.IfKeyword or
Completion\KeywordRecommenders\IfKeywordRecommender.cs (1)
13: base(SyntaxKind.IfKeyword, isValidInPreprocessorContext: true)
CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
66SyntaxKind.IfKeyword or
InitializeParameter\CSharpAddParameterCheckCodeRefactoringProvider.cs (1)
85ifKeyword: Token(SyntaxKind.IfKeyword),
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (43)
Generated\Syntax.Test.xml.Generated.cs (8)
410=> 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); 668=> InternalSyntaxFactory.IfDirectiveTrivia(InternalSyntaxFactory.Token(SyntaxKind.HashToken), InternalSyntaxFactory.Token(SyntaxKind.IfKeyword), GenerateIdentifierName(), InternalSyntaxFactory.Token(SyntaxKind.EndOfDirectiveToken), new bool(), new bool(), new bool()); 2350Assert.Equal(SyntaxKind.IfKeyword, node.IfKeyword.Kind); 3512Assert.Equal(SyntaxKind.IfKeyword, node.IfKeyword.Kind); 10386=> SyntaxFactory.IfStatement(new SyntaxList<AttributeListSyntax>(), SyntaxFactory.Token(SyntaxKind.IfKeyword), SyntaxFactory.Token(SyntaxKind.OpenParenToken), GenerateIdentifierName(), SyntaxFactory.Token(SyntaxKind.CloseParenToken), GenerateBlock(), default(ElseClauseSyntax)); 10644=> SyntaxFactory.IfDirectiveTrivia(SyntaxFactory.Token(SyntaxKind.HashToken), SyntaxFactory.Token(SyntaxKind.IfKeyword), GenerateIdentifierName(), SyntaxFactory.Token(SyntaxKind.EndOfDirectiveToken), new bool(), new bool(), new bool()); 12326Assert.Equal(SyntaxKind.IfKeyword, node.IfKeyword.Kind()); 13488Assert.Equal(SyntaxKind.IfKeyword, node.IfKeyword.Kind());
Parsing\DeclarationExpressionTests.cs (4)
66N(SyntaxKind.IfKeyword); 100N(SyntaxKind.IfKeyword); 150N(SyntaxKind.IfKeyword); 193N(SyntaxKind.IfKeyword);
Parsing\DeconstructionTests.cs (2)
2698N(SyntaxKind.IfKeyword); 2760N(SyntaxKind.IfKeyword);
Parsing\PatternParsingTests.cs (13)
2893N(SyntaxKind.IfKeyword); 3101N(SyntaxKind.IfKeyword); 3159N(SyntaxKind.IfKeyword); 3219N(SyntaxKind.IfKeyword); 3284N(SyntaxKind.IfKeyword); 3351N(SyntaxKind.IfKeyword); 3409N(SyntaxKind.IfKeyword); 3469N(SyntaxKind.IfKeyword); 3534N(SyntaxKind.IfKeyword); 3601N(SyntaxKind.IfKeyword); 3675N(SyntaxKind.IfKeyword); 3751N(SyntaxKind.IfKeyword); 3832N(SyntaxKind.IfKeyword);
Parsing\StatementAttributeParsingTests.cs (2)
2205N(SyntaxKind.IfKeyword); 3212N(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()); 3615M(SyntaxKind.IfKeyword); 3690M(SyntaxKind.IfKeyword); 3717M(SyntaxKind.IfKeyword); 3776N(SyntaxKind.IfKeyword); 3800M(SyntaxKind.IfKeyword); 3856N(SyntaxKind.IfKeyword); 3865M(SyntaxKind.IfKeyword);
Syntax\SyntaxNodeTests.cs (3)
246Assert.Equal(SyntaxKind.IfKeyword, nodesAndTokens[2].Kind()); 283Assert.Equal(SyntaxKind.IfKeyword, nodesAndTokens[3].Kind()); 655Assert.Equal(SyntaxKind.IfKeyword, token.Kind());
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
Classification\ClassificationHelpers.cs (1)
75case SyntaxKind.IfKeyword:
CSharpSyntaxKinds.cs (1)
61public int IfKeyword => (int)SyntaxKind.IfKeyword;
ElasticTriviaFormattingRule.cs (1)
349return currentToken.Kind() != SyntaxKind.IfKeyword ? 1 : 0;
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (1)
325if (targetToken.Kind() is SyntaxKind.IfKeyword or
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
2652token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.IfKeyword))
SpacingFormattingRule.cs (1)
156(previousKind == SyntaxKind.IfKeyword || previousKind == SyntaxKind.WhileKeyword || previousKind == SyntaxKind.SwitchKeyword ||
TokenBasedFormattingRule.cs (1)
149if (previousToken.Kind() == SyntaxKind.ElseKeyword && currentToken.Kind() != SyntaxKind.IfKeyword)
Microsoft.CodeAnalysis.UnitTests (1)
CommonSyntaxTests.cs (1)
188var token = CSharp.SyntaxFactory.Token(CSharp.SyntaxKind.IfKeyword);