73 references to Condition
Microsoft.CodeAnalysis.CSharp (11)
Binder\Binder_Statements.cs (1)
2583var condition = binder.BindBooleanExpression(node.Condition, diagnostics);
Binder\ExpressionVariableFinder.cs (1)
205VisitNodeToBind(node.Condition);
Binder\LocalBinderFactory.cs (1)
819Visit(node.Condition, enclosing);
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); 8384public IfStatementSyntax WithIfKeyword(SyntaxToken ifKeyword) => Update(this.AttributeLists, 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); 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);
Microsoft.CodeAnalysis.CSharp.CodeStyle (10)
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (2)
56if (!ifStatement.Condition.IsKind(SyntaxKind.NotEqualsExpression)) 95var condition = (BinaryExpressionSyntax)ifStatement.Condition;
src\Analyzers\CSharp\Analyzers\UseCoalesceExpression\CSharpUseCoalesceExpressionForIfNullStatementCheckDiagnosticAnalyzer.cs (1)
39=> ifStatement.Condition;
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUpdateExpressionSyntaxHelper.cs (1)
36condition = ifStatement.Condition;
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
134if (!IsReferenceEqualsNullCheck(semanticModel, ifStatement.Condition, cancellationToken, out var testedExpression))
src\Analyzers\CSharp\Analyzers\UseNullPropagation\CSharpUseNullPropagationDiagnosticAnalyzer.cs (1)
93condition = ifStatement.Condition;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
169(nodeParent is IfStatementSyntax ifStatement && ifStatement.Condition == node) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (3)
501if (originalIfStatement.Condition == previousOriginalNode) 504if (!TypesAreCompatible(originalIfStatement.Condition, newIfStatement.Condition))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (2)
502var condition = IndentExpression(ifStatement, ifStatement.Condition, preferredIndentation).Parenthesize(includeElasticTrivia: false); 782yield return ifStatement.Condition;
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (1)
46if (operation.Syntax is IfStatementSyntax { Condition: CheckedExpressionSyntax exp })
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (2)
59var isExpression = (BinaryExpressionSyntax)ifStatement.Condition; 90var newIf = currentIf.ReplaceNode(currentIf.Condition, updatedCondition);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Semantics\ExtensionOperatorsTests.cs (1)
2179var opNode = tree.GetRoot().DescendantNodes().OfType<Syntax.IfStatementSyntax>().First().Condition;
Microsoft.CodeAnalysis.CSharp.Features (23)
ConvertLinq\ConvertForEachToLinqQuery\AbstractConverter.cs (2)
88ifStatement.Condition.WithCommentsFrom(ifStatement.OpenParenToken, ifStatement.CloseParenToken)) 276ifStatement.Condition.WithCommentsFrom(ifStatement.OpenParenToken, ifStatement.CloseParenToken))
Debugging\CSharpProximityExpressionsService.RelevantExpressionsCollector.cs (1)
48=> AddExpressionTerms(node.Condition, _expressions);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (2)
828return AreEquivalentIgnoringLambdaBodies(oldNode.Condition, newNode.Condition);
EditAndContinue\SyntaxComparer.cs (2)
882distance = ComputeWeightedDistance(leftIf.Condition, leftIf.Statement, rightIf.Condition, rightIf.Statement);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (1)
173return node.WithCondition(VisitNode(node.Condition))
InvertIf\CSharpInvertIfCodeRefactoringProvider.cs (1)
40=> ifNode.Condition;
Snippets\CSharpIfSnippetProvider.cs (1)
31=> node.Condition;
SplitOrMergeIfStatements\CSharpIfLikeStatementGenerator.cs (2)
33if (expression.Parent is IfStatementSyntax ifStatement && ifStatement.Condition == expression) 71return ifStatement.Condition;
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (2)
56if (!ifStatement.Condition.IsKind(SyntaxKind.NotEqualsExpression)) 95var condition = (BinaryExpressionSyntax)ifStatement.Condition;
src\Analyzers\CSharp\Analyzers\UseCoalesceExpression\CSharpUseCoalesceExpressionForIfNullStatementCheckDiagnosticAnalyzer.cs (1)
39=> ifStatement.Condition;
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUpdateExpressionSyntaxHelper.cs (1)
36condition = ifStatement.Condition;
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
134if (!IsReferenceEqualsNullCheck(semanticModel, ifStatement.Condition, cancellationToken, out var testedExpression))
src\Analyzers\CSharp\Analyzers\UseNullPropagation\CSharpUseNullPropagationDiagnosticAnalyzer.cs (1)
93condition = ifStatement.Condition;
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (2)
502var condition = IndentExpression(ifStatement, ifStatement.Condition, preferredIndentation).Parenthesize(includeElasticTrivia: false); 782yield return ifStatement.Condition;
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (1)
46if (operation.Syntax is IfStatementSyntax { Condition: CheckedExpressionSyntax exp })
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (2)
59var isExpression = (BinaryExpressionSyntax)ifStatement.Condition; 90var newIf = currentIf.ReplaceNode(currentIf.Condition, updatedCondition);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Compilation\GetSemanticInfoTests.cs (1)
975var condition = ifStatement.Condition;
Compilation\SemanticModelAPITests.cs (2)
4463var originalTypeInfo = model.GetTypeInfo(ifStatement.Condition); 4466var speculativeTypeInfo = specModel.GetTypeInfo(replacementIfStatement.Condition);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (10)
Generated\Syntax.Test.xml.Generated.cs (2)
12772Assert.NotNull(node.Condition); 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)
2026Assert.NotNull(ss.Condition); 2027Assert.Equal("a", ss.Condition.ToString()); 2049Assert.NotNull(ss.Condition); 2050Assert.Equal("a", ss.Condition.ToString()); 2075Assert.NotNull(ss.Condition); 2076Assert.Equal("a", ss.Condition.ToString()); 2088Assert.NotNull(subIf.Condition); 2089Assert.Equal("b", subIf.Condition.ToString());
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
169(nodeParent is IfStatementSyntax ifStatement && ifStatement.Condition == node) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (3)
501if (originalIfStatement.Condition == previousOriginalNode) 504if (!TypesAreCompatible(originalIfStatement.Condition, newIfStatement.Condition))
Microsoft.DotNet.CodeAnalysis (1)
Analyzers\AppContextDefaultsAnalyzer.cs (1)
96if (containingIfStatement.Condition.Kind() != SyntaxKind.LessThanOrEqualExpression)
Roslyn.Diagnostics.CSharp.Analyzers (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
169(nodeParent is IfStatementSyntax ifStatement && ifStatement.Condition == node) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (3)
501if (originalIfStatement.Condition == previousOriginalNode) 504if (!TypesAreCompatible(originalIfStatement.Condition, newIfStatement.Condition))
System.Private.CoreLib.Generators (1)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (1)
586if (HandleConditionalCase(ifStatement.Condition, ifStatement.Statement, ifStatement.Else))