SyntaxNode.FirstAncestorOrSelf Method

Definition

Overloads

FirstAncestorOrSelf<TNode,TArg>(Func<TNode,TArg,Boolean>, TArg, Boolean)

Gets the first node of type TNode that matches the predicate.

FirstAncestorOrSelf<TNode>(Func<TNode,Boolean>, Boolean)

Gets the first node of type TNode that matches the predicate.

FirstAncestorOrSelf<TNode,TArg>(Func<TNode,TArg,Boolean>, TArg, Boolean)

Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs

Gets the first node of type TNode that matches the predicate.

C#
public TNode? FirstAncestorOrSelf<TNode,TArg>(Func<TNode,TArg,bool> predicate, TArg argument, bool ascendOutOfTrivia = true) where TNode : Microsoft.CodeAnalysis.SyntaxNode;

Type Parameters

TNode
TArg

Parameters

predicate
Func<TNode,TArg,Boolean>
argument
TArg
ascendOutOfTrivia
Boolean

Returns

TNode

Applies to

Roslyn 4.13.0 och andra versioner
Produkt Versioner
Roslyn 4.2.0, 4.3.0, 4.4.0, 4.5.0, 4.6.0, 4.7.0, 4.8.0, 4.9.2, 3.6.0, 3.7.0, 3.8.0, 3.9.0, 3.10.0, 3.11.0, 4.0.1, 4.1.0, 4.12.2, 4.13.0

FirstAncestorOrSelf<TNode>(Func<TNode,Boolean>, Boolean)

Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs
Source:
SyntaxNode.cs

Gets the first node of type TNode that matches the predicate.

C#
public TNode FirstAncestorOrSelf<TNode>(Func<TNode,bool> predicate = default, bool ascendOutOfTrivia = true) where TNode : Microsoft.CodeAnalysis.SyntaxNode;
C#
public TNode? FirstAncestorOrSelf<TNode>(Func<TNode,bool>? predicate = default, bool ascendOutOfTrivia = true) where TNode : Microsoft.CodeAnalysis.SyntaxNode;

Type Parameters

TNode

Parameters

predicate
Func<TNode,Boolean>
ascendOutOfTrivia
Boolean

Returns

TNode

Applies to

Roslyn 4.13.0 och andra versioner
Produkt Versioner
Roslyn 4.2.0, 4.3.0, 4.4.0, 4.5.0, 4.6.0, 4.7.0, 4.8.0, 4.9.2, 3.0.0, 3.1.0, 3.2.0, 3.2.1, 3.3.1, 3.4.0, 3.5.0, 3.6.0, 3.7.0, 3.8.0, 3.9.0, 3.10.0, 3.11.0, 4.0.1, 4.1.0, 4.12.2, 4.13.0