Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ListPiece and DelimitedListBuilder. #1295

Merged
merged 3 commits into from
Oct 26, 2023
Merged

Conversation

munificent
Copy link
Member

@munificent munificent commented Oct 26, 2023

These classes started out just supporting argument lists, then grew to collection literals, then parameter lists, then switch expressions, and soon for loop headers.

Each time, I need to tweak how it works a little. (But not enough to not use it completely, since the comment handling is complex and is the same across all of those constructors.)

There was getting to be an unwieldy set of options being passed around. Cleaned that up by defining a separate ListStyle that contains those options and can be shuttled directly from DelimitedListBuilder to ListPiece.

I made the before and after bracket pieces optional since I'll be using ListPiece in a future PR for the updaters list in a for loop, which isn't delimited.

Did a bunch of other minor clean-up.

Also, many of the docs were out of date. Fixed those.

These classes started out just supporting argument lists, then grew to
collection literals, then parameter lists, then switch expressions,
and soon for loop headers.

Each time, I need to tweak how it works a little. (But not enough to
not use it completely, since the comment handling is complex and is
the same across all of those constructors.)

There was getting to be an unwieldy set of options being passed around.
Cleaned that up by defining a separate ListStyle that contains those
options and can be shuttled directly from DelimitedListBuilder to
ListPiece.

I made the before and after bracket pieces optional since for

Did a bunch of other minor clean-up.

Also, many of the docs were out of date. Fixed those.
@natebosch
Copy link
Member

natebosch commented Oct 26, 2023

I made the before and after bracket pieces optional since for

Can you complete this sentence in the commit message when you merge?

lib/src/piece/list.dart Show resolved Hide resolved
@munificent munificent merged commit 32e54c5 into main Oct 26, 2023
7 checks passed
@munificent munificent deleted the refactor-list-piece branch October 26, 2023 23:18
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.

3 participants