Descendants(SyntaxNode, Boolean) Method

Definition

Namespace Tomlyn.Syntax
Assembly Tomlyn.dll

Get all descendants in Depth-First-Search order of the node. Note that this method returns the node itself (last).

public static IEnumerable<SyntaxNodeBase> Descendants(this SyntaxNode node, bool includeTokensCommentsAndWhitespaces = false)

Parameters

node
SyntaxNode

The node to collect all descendants

includeTokensCommentsAndWhitespaces
Boolean

true to include tokens, comments and whitespaces.

Returns

IEnumerable<SyntaxNodeBase>
All descendants in Depth-First-Search order of the node.