Skip to content

SyntaxNode.Ancestors() does not specify order of returned list #81797

@richard-fine

Description

@richard-fine

Type of issue

Missing information

Description

The documentation for SyntaxNode.Ancestors() and .AncestorsAndSelf() does not specify the order of the nodes in the returned list. Knowing the order is important because it affects whether we can use LINQ selectors like .First() on the result and get what we expect.

By comparison, other docs pages (like ChildNodes, DescendantNodes, etc) do mention the ordering.

Page URL

https://learn.microsoft.com/en-us/dotnet/api/microsoft.codeanalysis.syntaxnode.ancestors?view=roslyn-dotnet-5.0.0&viewFallbackFrom=net-8.0

Content source URL

https://github.com/dotnet/roslyn-api-docs/blob/live/dotnet/xml/Microsoft.CodeAnalysis/SyntaxNode.xml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions