Skip to content

Updated how nested function calls are overflowed #5443

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ytmimi
Copy link
Contributor

@ytmimi ytmimi commented Jul 14, 2022

Fixes #5356

I feel like there's got to be a simpler way to handle this, so any recommendations on how we can update the implementation are greatly appreciated. I noticed that in the original issue the callee was being split overly multiple lines and tried to use that to conditionally determine whether we rewrite the expression as we did before by just calling expr.rewrite or go down a path where we do some extra work to figure out how we'll rewrite the overflowing function call.

I found it a bit strange that in some cases we need to indent the shape, while in others we need to unindent it, but I imagine that has something to do with what's happening when last_item_shape is called.

@ytmimi
Copy link
Contributor Author

ytmimi commented Jul 14, 2022

Also, I wonder if we should hold off on this until after #5337 is merged, to see if these changes play well with the proposed fn_call_layout option.

@ytmimi
Copy link
Contributor Author

ytmimi commented Jul 27, 2022

wondering if these changes need to be version gated 🤔

@ytmimi ytmimi added the p-low label Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Long chain of functions with generic parameter at the end gets badly formatted
1 participant