replacing(childAt:with:)

Creates a new collection by replacing the syntax element at the provided index.

SyntaxCollection.swift:179

This declaration is deprecated: Use .with(\\.[index], newValue) instead

func replacing(childAt index: Int, with syntax: Element) -> Self

Parameters

index

The index at which to replace the element in the collection.

syntax

The element to replace with.

Returns

A new collection with the new element at the provided index.