1 instantiation of WhileStatementSyntax
Microsoft.CodeAnalysis.CSharp (1)
Syntax.xml.Internal.Generated.cs (1)
12026internal override SyntaxNode CreateRed(SyntaxNode? parent, int position) => new CSharp.Syntax.WhileStatementSyntax(this, parent, position);
135 references to WhileStatementSyntax
Microsoft.CodeAnalysis.CSharp (28)
Binder\Binder_Statements.cs (2)
85result = BindWhile((WhileStatementSyntax)node, diagnostics); 2792private BoundStatement BindWhile(WhileStatementSyntax node, BindingDiagnosticBag diagnostics)
Binder\LocalBinderFactory.cs (1)
574public override void VisitWhileStatement(WhileStatementSyntax node)
Binder\WhileBinder.cs (3)
30var node = (WhileStatementSyntax)_syntax; 56condition = ((WhileStatementSyntax)_syntax).Condition;
Lowering\Instrumentation\DebugInfoInjector.cs (2)
253WhileStatementSyntax whileSyntax = (WhileStatementSyntax)original.Syntax;
Syntax.xml.Main.Generated.cs (7)
397public virtual TResult? VisitWhileStatement(WhileStatementSyntax node) => this.DefaultVisit(node); 1141public virtual void VisitWhileStatement(WhileStatementSyntax node) => this.DefaultVisit(node); 1884public override SyntaxNode? VisitWhileStatement(WhileStatementSyntax node) 4290public static WhileStatementSyntax WhileStatement(SyntaxList<AttributeListSyntax> attributeLists, SyntaxToken whileKeyword, SyntaxToken openParenToken, ExpressionSyntax condition, SyntaxToken closeParenToken, StatementSyntax statement) 4297return (WhileStatementSyntax)Syntax.InternalSyntax.SyntaxFactory.WhileStatement(attributeLists.Node.ToGreenList<Syntax.InternalSyntax.AttributeListSyntax>(), (Syntax.InternalSyntax.SyntaxToken)whileKeyword.Node!, (Syntax.InternalSyntax.SyntaxToken)openParenToken.Node!, (Syntax.InternalSyntax.ExpressionSyntax)condition.Green, (Syntax.InternalSyntax.SyntaxToken)closeParenToken.Node!, (Syntax.InternalSyntax.StatementSyntax)statement.Green).CreateRed(); 4301public static WhileStatementSyntax WhileStatement(SyntaxList<AttributeListSyntax> attributeLists, ExpressionSyntax condition, StatementSyntax statement) 4305public static WhileStatementSyntax WhileStatement(ExpressionSyntax condition, StatementSyntax statement)
Syntax.xml.Syntax.Generated.cs (9)
7458public WhileStatementSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxToken whileKeyword, SyntaxToken openParenToken, ExpressionSyntax condition, SyntaxToken closeParenToken, StatementSyntax statement) 7462var newNode = SyntaxFactory.WhileStatement(attributeLists, whileKeyword, openParenToken, condition, closeParenToken, statement); 7471public new WhileStatementSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.WhileKeyword, this.OpenParenToken, this.Condition, this.CloseParenToken, this.Statement); 7472public WhileStatementSyntax WithWhileKeyword(SyntaxToken whileKeyword) => Update(this.AttributeLists, whileKeyword, this.OpenParenToken, this.Condition, this.CloseParenToken, this.Statement); 7473public WhileStatementSyntax WithOpenParenToken(SyntaxToken openParenToken) => Update(this.AttributeLists, this.WhileKeyword, openParenToken, this.Condition, this.CloseParenToken, this.Statement); 7474public WhileStatementSyntax WithCondition(ExpressionSyntax condition) => Update(this.AttributeLists, this.WhileKeyword, this.OpenParenToken, condition, this.CloseParenToken, this.Statement); 7475public WhileStatementSyntax WithCloseParenToken(SyntaxToken closeParenToken) => Update(this.AttributeLists, this.WhileKeyword, this.OpenParenToken, this.Condition, closeParenToken, this.Statement); 7476public WhileStatementSyntax WithStatement(StatementSyntax statement) => Update(this.AttributeLists, this.WhileKeyword, this.OpenParenToken, this.Condition, this.CloseParenToken, statement); 7479public new WhileStatementSyntax AddAttributeLists(params AttributeListSyntax[] items) => WithAttributeLists(this.AttributeLists.AddRange(items));
Syntax\LookupPosition.cs (2)
361return ((WhileStatementSyntax)statement).WhileKeyword; 437return GetFirstExcludedToken(((WhileStatementSyntax)statement).Statement);
Syntax\WhileStatementSyntax.cs (2)
11public WhileStatementSyntax Update(SyntaxToken whileKeyword, SyntaxToken openParenToken, ExpressionSyntax condition, SyntaxToken closeParenToken, StatementSyntax statement) 20public static WhileStatementSyntax WhileStatement(SyntaxToken whileKeyword, SyntaxToken openParenToken, ExpressionSyntax condition, SyntaxToken closeParenToken, StatementSyntax statement)
Microsoft.CodeAnalysis.CSharp.CodeStyle (11)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (2)
170var whileStatement = (WhileStatementSyntax)current;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
174(nodeParent is WhileStatementSyntax whileStatement && whileStatement.Condition == node) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (3)
127WhileStatementSyntax; 142WhileStatementSyntax n => n.Statement, 709WhileStatementSyntax n => (n.OpenParenToken, n.CloseParenToken),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (2)
293WhileStatementSyntax whileStatement => whileStatement.CloseParenToken.Equals(token), 365WhileStatementSyntax or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
313if (node is WhileStatementSyntax whileStatement && whileStatement.Statement != null && !(whileStatement.Statement is BlockSyntax))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpHeaderFacts.cs (2)
91var node = TryGetAncestorForLocation<WhileStatementSyntax>(root, position, out whileStatement);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
38WhileStatementSyntax or
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
184WhileStatementSyntax whileStatement => InferTypeInWhileStatement(whileStatement), 251WhileStatementSyntax whileStatement => InferTypeInWhileStatement(whileStatement, token), 2377private IEnumerable<TypeInferenceInfo> InferTypeInWhileStatement(WhileStatementSyntax whileStatement, SyntaxToken? previousToken = null)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (5)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (1)
328or WhileStatementSyntax
AutomaticCompletion\AutomaticLineEnderCommandHandler_Helpers.cs (4)
151WhileStatementSyntax or ForEachStatementSyntax or ForStatementSyntax or LockStatementSyntax or UsingStatementSyntax 483WhileStatementSyntax whileStatementNode => ShouldAddBraceForWhileStatement(whileStatementNode, caretPosition), 727private static bool ShouldAddBraceForWhileStatement(WhileStatementSyntax whileStatementNode, int caretPosition) 946WhileStatementSyntax whileStatementNode => whileStatementNode.WithStatement(block),
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
Semantics\OutVarTests.cs (2)
16534var statement = (WhileStatementSyntax)SyntaxFactory.ParseStatement(@"
Semantics\PatternMatchingTests_Scope.cs (2)
7207var statement = (WhileStatementSyntax)SyntaxFactory.ParseStatement(@"
Microsoft.CodeAnalysis.CSharp.Features (27)
Debugging\CSharpProximityExpressionsService.RelevantExpressionsCollector.cs (1)
44public override void VisitWhileStatement(WhileStatementSyntax node)
Debugging\CSharpProximityExpressionsService.Worker.cs (1)
298AddLastStatementOfConstruct((statement as WhileStatementSyntax).Statement);
EditAndContinue\BreakpointSpans.cs (2)
608var whileStatement = (WhileStatementSyntax)statement;
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (6)
796return AreEquivalentActiveStatements((WhileStatementSyntax)oldStatement, (WhileStatementSyntax)newStatement); 831private static bool AreEquivalentActiveStatements(WhileStatementSyntax oldNode, WhileStatementSyntax newNode) 1808var whileStatement = (WhileStatementSyntax)node;
EditAndContinue\SyntaxComparer.cs (4)
868var leftWhile = (WhileStatementSyntax)leftNode; 869var rightWhile = (WhileStatementSyntax)rightNode;
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (1)
259public override SyntaxNode VisitWhileStatement(WhileStatementSyntax node)
ExtractMethod\CSharpSelectionValidator.Validator.cs (2)
41WhileStatementSyntax; 75WhileStatementSyntax;
Highlighting\KeywordHighlighters\LoopHighlighter.cs (2)
52case WhileStatementSyntax whileStatement: 73private static void HighlightWhileStatement(WhileStatementSyntax statement, List<TextSpan> spans)
InvertIf\CSharpInvertIfCodeRefactoringProvider.cs (2)
77case WhileStatementSyntax: 102CommonForEachStatementSyntax or DoStatementSyntax or WhileStatementSyntax or ForStatementSyntax
Snippets\CSharpWhileLoopSnippetProvider.cs (4)
21internal sealed class CSharpWhileLoopSnippetProvider() : AbstractWhileLoopSnippetProvider<WhileStatementSyntax, ExpressionSyntax> 30protected override ExpressionSyntax GetCondition(WhileStatementSyntax node) 33protected override int GetTargetCaretPosition(WhileStatementSyntax whileStatement, SourceText sourceText) 39protected override Task<Document> AddIndentationToDocumentAsync(Document document, WhileStatementSyntax whileStatement, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (2)
170var whileStatement = (WhileStatementSyntax)current;
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (20)
IOperation\IOperationTests_IBranchOperation.Extensions.cs (1)
70AssertOuterIsCorrespondingLoopOfInner<WhileStatementSyntax, ContinueStatementSyntax>(@"
IOperation\IOperationTests_IWhileUntilLoopStatement.cs (19)
122VerifyOperationTreeForTest<WhileStatementSyntax>(source, expectedOperationTree); 188VerifyOperationTreeForTest<WhileStatementSyntax>(source, expectedOperationTree); 269VerifyOperationTreeForTest<WhileStatementSyntax>(source, expectedOperationTree); 347VerifyOperationTreeForTest<WhileStatementSyntax>(source, expectedOperationTree); 417VerifyOperationTreeForTest<WhileStatementSyntax>(source, expectedOperationTree); 448VerifyOperationTreeForTest<WhileStatementSyntax>(source, expectedOperationTree); 509VerifyOperationTreeForTest<WhileStatementSyntax>(source, expectedOperationTree); 573VerifyOperationTreeForTest<WhileStatementSyntax>(source, expectedOperationTree); 638VerifyOperationTreeForTest<WhileStatementSyntax>(source, expectedOperationTree); 671VerifyOperationTreeForTest<WhileStatementSyntax>(source, expectedOperationTree); 736VerifyOperationTreeForTest<WhileStatementSyntax>(source, expectedOperationTree); 827VerifyOperationTreeForTest<WhileStatementSyntax>(source, expectedOperationTree); 930VerifyOperationTreeForTest<WhileStatementSyntax>(source, expectedOperationTree); 1001VerifyOperationTreeForTest<WhileStatementSyntax>(source, expectedOperationTree); 1047VerifyOperationTreeForTest<WhileStatementSyntax>(source, expectedOperationTree); 1084VerifyOperationTreeForTest<WhileStatementSyntax>(source, expectedOperationTree); 1120VerifyOperationTreeForTest<WhileStatementSyntax>(source, expectedOperationTree); 1194VerifyOperationTreeForTest<WhileStatementSyntax>(source, expectedOperationTree); 1294VerifyOperationTreeForTest<WhileStatementSyntax>(source, expectedOperationTree);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (7)
Generated\Syntax.Test.xml.Generated.cs (5)
10741private static WhileStatementSyntax GenerateWhileStatement() 12607var node = GenerateWhileStatement(); 12615var newNode = node.WithAttributeLists(node.AttributeLists).WithWhileKeyword(node.WhileKeyword).WithOpenParenToken(node.OpenParenToken).WithCondition(node.Condition).WithCloseParenToken(node.CloseParenToken).WithStatement(node.Statement); 17565var oldNode = GenerateWhileStatement(); 17581var oldNode = GenerateWhileStatement();
Parsing\StatementParsingTests.cs (2)
1478var ws = (WhileStatementSyntax)statement;
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
LocalVariableDeclaratorsCollector.cs (1)
66public override void VisitWhileStatement(WhileStatementSyntax node)
Microsoft.CodeAnalysis.CSharp.Workspaces (13)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
174(nodeParent is WhileStatementSyntax whileStatement && whileStatement.Condition == node) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (3)
127WhileStatementSyntax; 142WhileStatementSyntax n => n.Statement, 709WhileStatementSyntax n => (n.OpenParenToken, n.CloseParenToken),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (2)
293WhileStatementSyntax whileStatement => whileStatement.CloseParenToken.Equals(token), 365WhileStatementSyntax or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
313if (node is WhileStatementSyntax whileStatement && whileStatement.Statement != null && !(whileStatement.Statement is BlockSyntax))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpHeaderFacts.cs (2)
91var node = TryGetAncestorForLocation<WhileStatementSyntax>(root, position, out whileStatement);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
38WhileStatementSyntax or
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
184WhileStatementSyntax whileStatement => InferTypeInWhileStatement(whileStatement), 251WhileStatementSyntax whileStatement => InferTypeInWhileStatement(whileStatement, token), 2377private IEnumerable<TypeInferenceInfo> InferTypeInWhileStatement(WhileStatementSyntax whileStatement, SyntaxToken? previousToken = null)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (2)
713VerifySyntax<WhileStatementSyntax>( 718VerifySyntax<WhileStatementSyntax>(
Roslyn.Diagnostics.CSharp.Analyzers (13)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
174(nodeParent is WhileStatementSyntax whileStatement && whileStatement.Condition == node) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (3)
127WhileStatementSyntax; 142WhileStatementSyntax n => n.Statement, 709WhileStatementSyntax n => (n.OpenParenToken, n.CloseParenToken),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (2)
293WhileStatementSyntax whileStatement => whileStatement.CloseParenToken.Equals(token), 365WhileStatementSyntax or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
313if (node is WhileStatementSyntax whileStatement && whileStatement.Statement != null && !(whileStatement.Statement is BlockSyntax))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpHeaderFacts.cs (2)
91var node = TryGetAncestorForLocation<WhileStatementSyntax>(root, position, out whileStatement);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
38WhileStatementSyntax or
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
184WhileStatementSyntax whileStatement => InferTypeInWhileStatement(whileStatement), 251WhileStatementSyntax whileStatement => InferTypeInWhileStatement(whileStatement, token), 2377private IEnumerable<TypeInferenceInfo> InferTypeInWhileStatement(WhileStatementSyntax whileStatement, SyntaxToken? previousToken = null)