-
Notifications
You must be signed in to change notification settings - Fork 63
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
Enable line breaks after infix operators and in ADT declarations #280
Comments
So your specific example above is not specific to Fourmolu. Ormolu also hangs lists after infix operators + function calls, when it would be nicer (at least in this example, perhaps for all multiline RHS?) to put it on the next line. I think this is a worthwhile change that doesn't involve line length at all. Can you make an issue over at Ormolu and see what they think? To your general point, yes, fourmolu has the |
Hi @brandonchinn178!
Done! I've raised the following issue:
This also appears to happen in data type declarations. I've created another issue here:
I think that sounds very reasonable. Though perhaps it's worth making this option more fine-grained? One of the things that seems useful about |
RE: |
Is your feature request specific to Fourmolu?
Context
fourmolu
.fourmolu
to do this (until Line length limit in fourmolu #71 is solved), but we're wondering if we can get by with a combination of the existingfourmolu
and manual insertion of line breaks where necessary.)Specific issue
We have sections of code that are formatted roughly like this:
Note that after the infix function:
If we run this through
fourmolu
, the RHS is converted from a "newline + indent" to a "hanging indent":Obviously this is a rather extreme example 😄, but it does capture a general pattern.
Question 1
Is there some existing way to configure
fourmolu
so that it:Question 2
If the above type of configuration is currently impossible, then in your opinion, would it be extremely difficult for us to create a configuration option that makes the above behaviour possible?
I'd be very happy to submit a PR, but I'm not entirely sure where in the
fourmolu
code base I should be looking.I did notice the following type:
I've tried adjusting the code to use
Normal
instead ofHanging
in certain places, but I'm not sure if it's relevant to the problem we're trying to solve, as it doesn't appear to affect the pretty-printing of the above source code snippet.Many thanks for your help!
Jonathan
The text was updated successfully, but these errors were encountered: