+(_:_:)
Creates a new collection by concatenating the elements of a collection and a sequence.
static func + (lhs: Self, rhs: some RangeReplaceableCollection<Element>) -> Self
Creates a new collection by concatenating the elements of a collection and a sequence.
static func + (lhs: Self, rhs: some RangeReplaceableCollection<Element>) -> Self
s11SwiftSyntax0B10CollectionPAAE1poiyxx_qd__tSmRd__7ElementQyd__AERtzlFZ
What are these?5UZD5
import SwiftSyntax
A library for working with Swift code.
protocol SyntaxCollection : BidirectionalCollection, ExpressibleByArrayLiteral, SyntaxProtocol where Self.Element : SyntaxProtocol, Self.Index == SyntaxChildrenIndex
protocol RangeReplaceableCollection<Element> : Collection where Self.SubSequence : RangeReplaceableCollection
A collection that supports replacement of an arbitrary subrange of elements with the elements of another collection.
associatedtype Element
init<Children>(_ children: Children) where Children : Sequence, Self.Element == Children.Element
init(arrayLiteral elements: Element...)
static var structure: SyntaxNodeStructure { get }
var count: Int { get }
The number of elements, present
or missing
, in this collection.
var endIndex: SyntaxChildrenIndex { get }
var startIndex: SyntaxChildrenIndex { get }
subscript(position: SyntaxChildrenIndex) -> Element { get set }
static func + (lhs: some Sequence<Element>, rhs: Self) -> Self
Creates a new collection by concatenating the elements of a sequence and a collection.
static func + (lhs: some RangeReplaceableCollection<Element>, rhs: Self) -> Self
Creates a new collection by concatenating the elements of a sequence and a collection.
static func + (lhs: Self, rhs: some Sequence<Element>) -> Self
Creates a new collection by concatenating the elements of a collection and a sequence.
static func += (lhs: inout Self, rhs: some Sequence<Element>)
Appends the elements of a sequence to a range-replaceable collection.
mutating func append(_ newElement: Element)
Adds an element to the end of the collection.
mutating func append(contentsOf newElements: some Sequence<Element>)
Adds the elements of a sequence to the end of this collection.
func distance(from start: SyntaxChildrenIndex, to end: SyntaxChildrenIndex) -> Int
func filter(_ isIncluded: (Element) throws -> Bool) rethrows -> Self
Returns a new SyntaxCollection
that just contains the elements satisfying the given predicate.
func index(after index: SyntaxChildrenIndex) -> SyntaxChildrenIndex
func index(at offset: Int) -> SyntaxChildrenIndex
Returns the index of the n-th element in this collection.
func index(before index: SyntaxChildrenIndex) -> SyntaxChildrenIndex
func index(of node: Element) -> SyntaxChildrenIndex?
Return the index of node
within this collection.
func index(of node: some SyntaxProtocol) -> SyntaxChildrenIndex?
Return the index of node
within this collection.
mutating func insert(_ newElement: Element, at i: Index)
Inserts a new element into the collection at the specified position.
mutating func insert(contentsOf newElements: some Collection<Element>, at i: Index)
Inserts the elements of a sequence into the collection at the specified position.
func makeIterator() -> SyntaxCollectionIterator<Element>
@discardableResult mutating func remove(at position: Index) -> Element
Removes and returns the element at the specified position.
mutating func removeSubrange(_ bounds: Range<Index>)
Removes the elements in the specified subrange from the collection.
mutating func replaceSubrange(_ subrange: Range<Self.Index>, with newElements: some Collection<Element>)
Replace the nodes in subrange
by newElements
.
init(_ collection: Self)
Initialize the collection from a collection of the same type.
func appending(_ syntax: Element) -> Self
Creates a new collection by appending the provided syntax element to the children.
func inserting(_ syntax: Element, at index: Int) -> Self
Creates a new collection by inserting the provided syntax element at the provided index in the children.
func prepending(_ syntax: Element) -> Self
Creates a new collection by prepending the provided syntax element to the children.
func removing(childAt index: Int) -> Self
Creates a new collection by removing the syntax element at the provided index.
func removingFirst() -> Self
Creates a new collection by removing the first element.
func removingLast() -> Self
Creates a new collection by removing the last element.
func replacing(childAt index: Int, with syntax: Element) -> Self
Creates a new collection by replacing the syntax element at the provided index.