Tokens(SyntaxNode, Boolean) Method

Definition

Namespace Tomlyn.Syntax
Assembly Tomlyn.dll

Get all SyntaxToken and SyntaxTrivia in Depth-First-Search order of the node.

public static IEnumerable<SyntaxNodeBase> Tokens(this SyntaxNode node, bool includeCommentsAndWhitespaces = true)

Parameters

node
SyntaxNode

The node to collect all tokens from

includeCommentsAndWhitespaces
Boolean

true to include comments and whitespaces.

Returns

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