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.
First time submitting so there's probably a bunch of stuff I'm doing wrong and we'll have to work out the licensing stuff.
This is a PR to handle the issues in #844 where when there is a line that contains logical operators and we split on an operator, we want to split on all operators in that logical line.
I added a new knob to allow this feature to be toggled on. It is off by default for all styles to preserve the existing functioning of the styles.
I haven't pushed up any tests with this, so that will have to happen before this is merged obviously. However as part of my local testing I ran into some edge cases where you had to be able to set
SPLIT_PENALTY_LOGICAL_OPERATOR
and have it be respected. But the code as it previously existed would ignore penalties if the initial parse set any penalty value even if the desired penalty was higher than what the parse decided on. This prevented the line wrapping from being correct in some extreme edge cases. To get around that, I updated logical line to use the higherSPLIT_PENALTY_LOGICAL_OPERATOR
but only in the case where the new knob was turned on. I was hesitant to change the normal (existing) behavior of that method, though I do believe that it probably should be considered at some point because higher penalties should probably propagate.