Represent binary operators as breakables #452
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #379
This PR yanks out the hacked-together multilining strategy for binary operators and makes them breakables instead. This was largely easier than I though -- IIRC the original reason for not doing this was that call chains weren't also breakables, so that resulted in weird interactions, but since we did that in #443, this is a pretty straightforward change.
The way this works is that instead of our old hacked-together system, we can wrap the "top-level" binary in a breakable, and then for nested breakables, we just recurse into the formatting function instead of making a new breakable, which keeps the old behavior of keeping chained binary operations all at the same level.
This also fixed a number of accidental interactions that I wasn't aware of but that I think are actually bugs -- in the fixtures that we changed, this PR makes it so that binary operators now respect user-multiling in all cases, which they didn't used to do but which is consistent with the approach taken for other breakable items.