Fix regression with multiline record types#160
Conversation
6cb86cc to
8568851
Compare
|
@georgefst it would be great to merge this + release 0.5.1 to fix the regression quickly |
|
I'm reluctant to merge this as-is, since unfortunately while it fixes one regression, in a sense it introduces a new one. I, for one, am already using Fourmolu 0.5 and would rather avoid the churn that this would entail. I also don't quite understand all of your concerns, so I could do with a little explanation.
I don't really see why this is an issue? Why should different options be consistent in this way?
That certainly is problematic. I haven't tested this extensively, but I think we can keep the best of both worlds if we hack in an indentation decrease by changing line 279 to: mapM_ (inciBy (-2) . (newline >>) . p_hsDocString Caret False) cd_fld_doc
I'm unsure what I'm supposed to be looking at here. I think the first output is a bit ugly, but that isn't affected by removing or re-adding |
I guess, personally, I would expect that the comments, regardless of being
I can try that
If you look at the first example, the do block is not indented in the second element of the tuple. it's indented in every other example |
Sure, but this output isn't affected by the changes in #124. It appears to be a separate issue. Is it a regression? If so, we should try to bisect. |
|
ah you're right... i'm not sure why i connected that issue to this. i'll move that discussion to a separate branch |
|
@georgefst Fixed! Tested that the below does not reformat with newtype App a = App
{ unApp ::
JobExecutorT
( ReaderT
MyConfig
(LoggingT IO)
)
a
, a :: Int
-- ^ asfd
, b :: Bool
-- ^ asdf
}I didn't add this as a test yet, because I'm not sure what we want to do about testing (did you get my latest email?). I'm personally of the mindset that |
8568851 to
0849bda
Compare
0849bda to
0db90b5
Compare
0db90b5 to
24b1bb2
Compare
|
@georgefst Thanks! I'll be making a release shortly |
Partially revert #124 (specifically, the removal of
sitcc) to fix #145Completely separate from whether it looks better or not, that change actually causes inconsistencies with different options. Some examples are below. TL;DR we should revert this for now to fix the inconsistencies, then we can make the trailing comment indentation configurable for aesthetic reasons
Record field inconsistencies
With
--indentation=4,--comma-style=trailingand--comma-style=leadingwill indent the two comments differently:But in addition to this, using
--indentation=2, it also causes multiline types to be deindented (noteJobExecutorTbeing deindented afterunAppwith--comma-style=leading):