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

Router: fix scala.js style for binPack.callSite #3931

Merged
merged 1 commit into from
Apr 14, 2024

Conversation

kitbellew
Copy link
Collaborator

Previously, how we handle binpack.callSite=true depended only on optIn.configStyleArguments, and danglingParentheses.callSite was ignored completely.

Also, the declared scala.js style, which purported to depend on the existence of a break before closing parenthesis, wasn't properly done.

Both opening and closing parentheses were output tucked in all cases but one, when both of them were dangling in the input (and the choice of whether to dangle or tuck depended solely on configStyleArguments).

Now let's introduce a small modification, so that we can express more formatting alternatives, and fix scala.js style.

Specifically, associate the two variants above with dangling parentheses in the disabled state.

When it's enabled, determine whether to tuck or dangle on break before closing parenthesis. Also, apply config style when that parenthesis is dangling and configStyleArguments is disabled (because in the enabled state, it requires both parentheses to be dangling to be triggered).

Previously, how we handle `binpack.callSite=true` depended only on
`optIn.configStyleArguments`, and `danglingParentheses.callSite` was
ignored completely.

Also, the declared `scala.js` style, which purported to depend on the
existence of a break before closing parenthesis, wasn't properly done.

Both opening and closing parentheses were output tucked in all cases
but one, when both of them were dangling in the input (and the choice
of whether to dangle or tuck depended solely on `configStyleArguments`).

Now let's introduce a small modification, so that we can express more
formatting alternatives, and fix `scala.js` style.

Specifically, associate the two variants above with dangling parentheses
in the disabled state.

When it's enabled, determine whether to tuck or dangle on break before
closing parenthesis. Also, apply config style when that parenthesis is
dangling and `configStyleArguments` is disabled (because in the enabled
state, it requires both parentheses to be dangling to be triggered).
@kitbellew kitbellew requested a review from tgodzik April 12, 2024 15:09
@kitbellew kitbellew merged commit 760de95 into scalameta:master Apr 14, 2024
9 checks passed
@kitbellew kitbellew deleted the 3931 branch April 14, 2024 20:02
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