Skip to main content

SyntaxExtensions.FirstDescendant Method

Containing Type: SyntaxExtensions

Assembly: Roslynator.Core.dll

Overloads

MethodSummary
FirstDescendant<TNode>(SyntaxNode, Func<SyntaxNode, Boolean>, Boolean)Searches a list of descendant nodes in prefix document order and returns first descendant of type TNode.
FirstDescendant<TNode>(SyntaxNode, TextSpan, Func<SyntaxNode, Boolean>, Boolean)Searches a list of descendant nodes in prefix document order and returns first descendant of type TNode.

FirstDescendant<TNode>(SyntaxNode, Func<SyntaxNode, Boolean>, Boolean)

Searches a list of descendant nodes in prefix document order and returns first descendant of type TNode.

public static TNode? FirstDescendant<TNode>(this Microsoft.CodeAnalysis.SyntaxNode node, Func<Microsoft.CodeAnalysis.SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false) where TNode : Microsoft.CodeAnalysis.SyntaxNode

Type Parameters

TNode

Parameters

node SyntaxNode

descendIntoChildren Func<SyntaxNode, Boolean>

descendIntoTrivia Boolean

Returns

TNode

FirstDescendant<TNode>(SyntaxNode, TextSpan, Func<SyntaxNode, Boolean>, Boolean)

Searches a list of descendant nodes in prefix document order and returns first descendant of type TNode.

public static TNode? FirstDescendant<TNode>(this Microsoft.CodeAnalysis.SyntaxNode node, Microsoft.CodeAnalysis.Text.TextSpan span, Func<Microsoft.CodeAnalysis.SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false) where TNode : Microsoft.CodeAnalysis.SyntaxNode

Type Parameters

TNode

Parameters

node SyntaxNode

span TextSpan

descendIntoChildren Func<SyntaxNode, Boolean>

descendIntoTrivia Boolean

Returns

TNode