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

POC double indentation. #3039

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

nojaf
Copy link
Contributor

@nojaf nojaf commented Jan 30, 2024

Quick implementation of having double indentation for long function signature parameters.

//cc @auduchinok @dawedawe @josh-degraw @Smaug123

Note that the equals sign rule didn't change. The guide is pretty clear on that. It goes on its own line.
Unless the last parameter is a long tuple.

For the sake of source control, I wouldn't change that:

image

image

@Smaug123
Copy link
Contributor

Smaug123 commented Feb 2, 2024

@auduchinok I'd be interested to hear more about what this change lets you do.

@nojaf nojaf force-pushed the poc/double-indent branch from e10b3a7 to c4f0774 Compare February 9, 2024 10:52
equal
"""
type X() =
member x.Y
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@auduchinok this does the double indent but has the multiline tuple parameter.
According to the existing lore, we indent each entry of the tuple.
Does this meet your expectations?

@nojaf
Copy link
Contributor Author

nojaf commented Mar 14, 2024

I talked a bit more with @auduchinok on this.

It could be interesting to follow the approach of putting parameters on the current line until the max line length is crossed:

Screenshot 2024-03-13 at 15 00 15
Screenshot 2024-03-13 at 14 54 45
Screenshot 2024-03-13 at 14 56 06
Screenshot 2024-03-13 at 15 00 08
Screenshot 2024-03-13 at 14 54 41
Screenshot 2024-03-13 at 14 18 05
Screenshot 2024-03-13 at 14 18 01

It keeps things compact and having the double indent helps to differentiate the parameters with the body.

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