40 references to IfKeyword
Microsoft.CodeAnalysis.CSharp (10)
Lowering\Instrumentation\DebugInfoInjector.cs (1)
365syntax.IfKeyword.SpanStart,
Syntax.xml.Main.Generated.cs (1)
1915=> node.Update(VisitList(node.AttributeLists), VisitToken(node.IfKeyword), VisitToken(node.OpenParenToken), (ExpressionSyntax?)Visit(node.Condition) ?? throw new ArgumentNullException("condition"), VisitToken(node.CloseParenToken), (StatementSyntax?)Visit(node.Statement) ?? throw new ArgumentNullException("statement"), (ElseClauseSyntax?)Visit(node.Else));
Syntax.xml.Syntax.Generated.cs (7)
8372if (attributeLists != this.AttributeLists || ifKeyword != this.IfKeyword || openParenToken != this.OpenParenToken || condition != this.Condition || closeParenToken != this.CloseParenToken || statement != this.Statement || @else != this.Else) 8383public new IfStatementSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.IfKeyword, this.OpenParenToken, this.Condition, this.CloseParenToken, this.Statement, this.Else); 8385public IfStatementSyntax WithOpenParenToken(SyntaxToken openParenToken) => Update(this.AttributeLists, this.IfKeyword, openParenToken, this.Condition, this.CloseParenToken, this.Statement, this.Else); 8386public IfStatementSyntax WithCondition(ExpressionSyntax condition) => Update(this.AttributeLists, this.IfKeyword, this.OpenParenToken, condition, this.CloseParenToken, this.Statement, this.Else); 8387public IfStatementSyntax WithCloseParenToken(SyntaxToken closeParenToken) => Update(this.AttributeLists, this.IfKeyword, this.OpenParenToken, this.Condition, closeParenToken, this.Statement, this.Else); 8388public IfStatementSyntax WithStatement(StatementSyntax statement) => Update(this.AttributeLists, this.IfKeyword, this.OpenParenToken, this.Condition, this.CloseParenToken, statement, this.Else); 8389public IfStatementSyntax WithElse(ElseClauseSyntax? @else) => Update(this.AttributeLists, this.IfKeyword, this.OpenParenToken, this.Condition, this.CloseParenToken, this.Statement, @else);
Syntax\LookupPosition.cs (1)
343return ((IfStatementSyntax)statement).IfKeyword;
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
165ifStatement.IfKeyword.GetLocation(),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
40AddSuppressWrappingIfOnSingleLineOperation(list, ifStatementNode.IfKeyword, ifStatementNode.Statement.GetLastToken(includeZeroWidth: true));
Microsoft.CodeAnalysis.CSharp.Features (16)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (1)
72SwitchKeyword.WithTriviaFrom(ifStatement.IfKeyword),
ConvertLinq\ConvertForEachToLinqQuery\AbstractConverter.cs (3)
87.WithCommentsFrom(ifStatement.IfKeyword.LeadingTrivia, ifStatement.IfKeyword.TrailingTrivia), 277.WithCommentsFrom(ifStatement.IfKeyword.GetAllTrivia().Concat(node.ExtraLeadingComments), node.ExtraTrailingComments);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
1794return TextSpan.FromBounds(ifStatement.IfKeyword.SpanStart, ifStatement.CloseParenToken.Span.End);
Highlighting\KeywordHighlighters\IfStatementHighlighter.cs (4)
43highlights.Add(ifStatement.IfKeyword.Span); 53if (OnlySpacesBetween(elseKeyword, elseIfStatement.IfKeyword)) 58elseIfStatement.IfKeyword.Span.End)); 64highlights.Add(elseIfStatement.IfKeyword.Span);
SplitOrMergeIfStatements\CSharpMergeConsecutiveIfStatementsCodeRefactoringProvider.cs (3)
37span.IsAround(ifStatement.IfKeyword) || 38span.IsAround(ifStatement.IfKeyword, ifStatement.CloseParenToken) || 39span.IsAround(ifStatement.IfKeyword, ifStatement.Statement))
SplitOrMergeIfStatements\CSharpMergeNestedIfStatementsCodeRefactoringProvider.cs (3)
37span.IsAround(ifStatement.IfKeyword) || 38span.IsAround(ifStatement.IfKeyword, ifStatement.CloseParenToken) || 39span.IsAround(ifStatement.IfKeyword, ifStatement))
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
165ifStatement.IfKeyword.GetLocation(),
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (10)
Generated\Syntax.Test.xml.Generated.cs (2)
12770Assert.Equal(SyntaxKind.IfKeyword, node.IfKeyword.Kind()); 12776var newNode = node.WithAttributeLists(node.AttributeLists).WithIfKeyword(node.IfKeyword).WithOpenParenToken(node.OpenParenToken).WithCondition(node.Condition).WithCloseParenToken(node.CloseParenToken).WithStatement(node.Statement).WithElse(node.Else);
Parsing\StatementParsingTests.cs (8)
2023Assert.NotEqual(default, ss.IfKeyword); 2024Assert.Equal(SyntaxKind.IfKeyword, ss.IfKeyword.Kind()); 2046Assert.NotEqual(default, ss.IfKeyword); 2047Assert.Equal(SyntaxKind.IfKeyword, ss.IfKeyword.Kind()); 2072Assert.NotEqual(default, ss.IfKeyword); 2073Assert.Equal(SyntaxKind.IfKeyword, ss.IfKeyword.Kind()); 2086Assert.NotEqual(default, subIf.IfKeyword); 2087Assert.Equal(SyntaxKind.IfKeyword, subIf.IfKeyword.Kind());
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
40AddSuppressWrappingIfOnSingleLineOperation(list, ifStatementNode.IfKeyword, ifStatementNode.Statement.GetLastToken(includeZeroWidth: true));
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
40AddSuppressWrappingIfOnSingleLineOperation(list, ifStatementNode.IfKeyword, ifStatementNode.Statement.GetLastToken(includeZeroWidth: true));