Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/Compilers/Core/Portable/Syntax/SyntaxNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ public IEnumerable<SyntaxNode> ChildNodes()
}

/// <summary>
/// Gets a list of ancestor nodes
/// Gets a list of ancestor nodes in order from the innermost containing syntactic ancestor to the outermost.
/// </summary>
public IEnumerable<SyntaxNode> Ancestors(bool ascendOutOfTrivia = true)
{
Expand All @@ -806,7 +806,7 @@ public IEnumerable<SyntaxNode> Ancestors(bool ascendOutOfTrivia = true)
}

/// <summary>
/// Gets a list of ancestor nodes (including this node)
/// Gets a list of ancestor nodes (including this node) in order from this node to the outermost ancestor.
/// </summary>
public IEnumerable<SyntaxNode> AncestorsAndSelf(bool ascendOutOfTrivia = true)
{
Expand All @@ -832,7 +832,8 @@ public IEnumerable<SyntaxNode> AncestorsAndSelf(bool ascendOutOfTrivia = true)
}

/// <summary>
/// Gets the first node of type TNode that matches the predicate.
/// Gets the first node of type TNode that matches the predicate. Ancestors are searched in order from
/// this node to the outermost ancestor.
/// </summary>
public TNode? FirstAncestorOrSelf<TNode>(Func<TNode, bool>? predicate = null, bool ascendOutOfTrivia = true)
where TNode : SyntaxNode
Expand All @@ -850,7 +851,8 @@ public IEnumerable<SyntaxNode> AncestorsAndSelf(bool ascendOutOfTrivia = true)
}

/// <summary>
/// Gets the first node of type TNode that matches the predicate.
/// Gets the first node of type TNode that matches the predicate. Ancestors are searched in order from
/// this node to the outermost ancestor.
/// </summary>
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple public overloads with optional parameters", Justification = "Required for consistent API usage patterns.")]
public TNode? FirstAncestorOrSelf<TNode, TArg>(Func<TNode, TArg, bool> predicate, TArg argument, bool ascendOutOfTrivia = true)
Expand Down