SeparatedSyntaxList Class
Builds SeparatedSyntaxList<TNode> instances.
public static class SeparatedSyntaxListMethods
| Name | Description |
|---|---|
| Create<TNode>(ReadOnlySpan<TNode>) | Creates a detached list holding nodes, with the separator of their language between each pair. |
Create<TNode>(ReadOnlySpan<TNode>)
SeparatedSyntaxList.csCreates a detached list holding nodes, with the separator of their language between each pair.
public static SeparatedSyntaxList<TNode> Create<TNode>(ReadOnlySpan<TNode> nodes) where TNode : SyntaxNodeType parameters
TNode
Parameters
nodesReadOnlySpan<TNode>
Returns
Exceptions
InvalidOperationException- There is more than one node and the language does not define a separator for its lists.
Remarks
This is what a collection expression targeting SeparatedSyntaxList<TNode> builds its list with, so [a, b] gives the same list as adding a then b to an empty one.