36 references to IfKeyword
Microsoft.CodeAnalysis.CSharp (10)
_generated\0\Syntax.xml.Main.Generated.cs (1)
1927
=> 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));
_generated\2\Syntax.xml.Syntax.Generated.cs (7)
8418
if (attributeLists != this.AttributeLists || ifKeyword != this.
IfKeyword
|| openParenToken != this.OpenParenToken || condition != this.Condition || closeParenToken != this.CloseParenToken || statement != this.Statement || @else != this.Else)
8429
public new IfStatementSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.
IfKeyword
, this.OpenParenToken, this.Condition, this.CloseParenToken, this.Statement, this.Else);
8431
public IfStatementSyntax WithOpenParenToken(SyntaxToken openParenToken) => Update(this.AttributeLists, this.
IfKeyword
, openParenToken, this.Condition, this.CloseParenToken, this.Statement, this.Else);
8432
public IfStatementSyntax WithCondition(ExpressionSyntax condition) => Update(this.AttributeLists, this.
IfKeyword
, this.OpenParenToken, condition, this.CloseParenToken, this.Statement, this.Else);
8433
public IfStatementSyntax WithCloseParenToken(SyntaxToken closeParenToken) => Update(this.AttributeLists, this.
IfKeyword
, this.OpenParenToken, this.Condition, closeParenToken, this.Statement, this.Else);
8434
public IfStatementSyntax WithStatement(StatementSyntax statement) => Update(this.AttributeLists, this.
IfKeyword
, this.OpenParenToken, this.Condition, this.CloseParenToken, statement, this.Else);
8435
public IfStatementSyntax WithElse(ElseClauseSyntax? @else) => Update(this.AttributeLists, this.
IfKeyword
, this.OpenParenToken, this.Condition, this.CloseParenToken, this.Statement, @else);
Lowering\Instrumentation\DebugInfoInjector.cs (1)
365
syntax.
IfKeyword
.SpanStart,
Syntax\LookupPosition.cs (1)
343
return ((IfStatementSyntax)statement).
IfKeyword
;
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
165
ifStatement.
IfKeyword
.GetLocation(),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
313
if (node is ElseClauseSyntax { ElseKeyword: var elseKeyword, Statement: IfStatementSyntax {
IfKeyword
: var ifKeyword } } &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
40
AddSuppressWrappingIfOnSingleLineOperation(list, ifStatementNode.
IfKeyword
, ifStatementNode.Statement.GetLastToken(includeZeroWidth: true));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Formatting\CSharpSyntaxFormattingService.cs (1)
161
document.Text.AreOnSameLine(token, ifStatement.
IfKeyword
))
Microsoft.CodeAnalysis.CSharp.Features (16)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (1)
72
SwitchKeyword.WithTriviaFrom(ifStatement.
IfKeyword
),
ConvertLinq\ConvertForEachToLinqQuery\AbstractConverter.cs (3)
87
.WithCommentsFrom(ifStatement.
IfKeyword
.LeadingTrivia, ifStatement.
IfKeyword
.TrailingTrivia),
276
.WithCommentsFrom(ifStatement.
IfKeyword
.GetAllTrivia().Concat(node.ExtraLeadingComments), node.ExtraTrailingComments);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
1794
return TextSpan.FromBounds(ifStatement.
IfKeyword
.SpanStart, ifStatement.CloseParenToken.Span.End);
Highlighting\KeywordHighlighters\IfStatementHighlighter.cs (4)
43
highlights.Add(ifStatement.
IfKeyword
.Span);
53
if (OnlySpacesBetween(elseKeyword, elseIfStatement.
IfKeyword
))
58
elseIfStatement.
IfKeyword
.Span.End));
64
highlights.Add(elseIfStatement.
IfKeyword
.Span);
SplitOrMergeIfStatements\CSharpMergeConsecutiveIfStatementsCodeRefactoringProvider.cs (3)
37
span.IsAround(ifStatement.
IfKeyword
) ||
38
span.IsAround(ifStatement.
IfKeyword
, ifStatement.CloseParenToken) ||
39
span.IsAround(ifStatement.
IfKeyword
, ifStatement.Statement))
SplitOrMergeIfStatements\CSharpMergeNestedIfStatementsCodeRefactoringProvider.cs (3)
37
span.IsAround(ifStatement.
IfKeyword
) ||
38
span.IsAround(ifStatement.
IfKeyword
, ifStatement.CloseParenToken) ||
39
span.IsAround(ifStatement.
IfKeyword
, ifStatement))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
165
ifStatement.
IfKeyword
.GetLocation(),
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
313
if (node is ElseClauseSyntax { ElseKeyword: var elseKeyword, Statement: IfStatementSyntax {
IfKeyword
: var ifKeyword } } &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
40
AddSuppressWrappingIfOnSingleLineOperation(list, ifStatementNode.
IfKeyword
, ifStatementNode.Statement.GetLastToken(includeZeroWidth: true));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Formatting\CSharpSyntaxFormattingService.cs (1)
161
document.Text.AreOnSameLine(token, ifStatement.
IfKeyword
))
Roslyn.Diagnostics.CSharp.Analyzers (3)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
313
if (node is ElseClauseSyntax { ElseKeyword: var elseKeyword, Statement: IfStatementSyntax {
IfKeyword
: var ifKeyword } } &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
40
AddSuppressWrappingIfOnSingleLineOperation(list, ifStatementNode.
IfKeyword
, ifStatementNode.Statement.GetLastToken(includeZeroWidth: true));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Formatting\CSharpSyntaxFormattingService.cs (1)
161
document.Text.AreOnSameLine(token, ifStatement.
IfKeyword
))