Skip to content

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jul 6, 2023

Instead of re-inventing the wheel and providing hand-written appending etc. functions on SyntaxCollection, clients should use the methods on Array to manipulate the elements of a SyntaxCollection and create a new collection node once the manipulation is done.

@ahoppen ahoppen requested review from rintaro and bnbarham July 6, 2023 09:34
@ahoppen ahoppen requested a review from DougGregor as a code owner July 6, 2023 09:34
@ahoppen
Copy link
Member Author

ahoppen commented Jul 6, 2023

@swift-ci Please test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually end up manipulating the array away. I do wonder if I'm going to miss removingFirst(), because it feels like I do that a lot (but perhaps shouldn't).

Instead of re-inventing the wheel and providing hand-written `appending` etc. functions on `SyntaxCollection`, clients should use the methods on `Array` to manipulate the elements of a `SyntaxCollection` and create a new collection node once the manipulation is done.
@ahoppen ahoppen force-pushed the ahoppen/syntax-collection-manipulation branch from 3331e70 to 85e2d3a Compare July 7, 2023 08:42
@ahoppen
Copy link
Member Author

ahoppen commented Jul 7, 2023

@swift-ci Please test

@ahoppen ahoppen enabled auto-merge July 7, 2023 08:43
@ahoppen
Copy link
Member Author

ahoppen commented Jul 7, 2023

@swift-ci Please test Windows

@ahoppen ahoppen merged commit 69c0be3 into swiftlang:main Jul 7, 2023
@ahoppen ahoppen deleted the ahoppen/syntax-collection-manipulation branch August 4, 2025 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants