Fix inconsistent comment indentation in parameter lists#346
Fix inconsistent comment indentation in parameter lists#346jfly merged 1 commit intoNixOS:masterfrom
Conversation
Addresses inconsistent indentation of comments after the last parameter in function parameter lists. Comments following all parameters were incorrectly indented one level less than comments between parameters.
There was a problem hiding this comment.
This LGTM, thanks! But I don't understand the actual Haskell change, so take my approval with a grain of salt.
I'd appreciate being educated though, if anyone has the patience. See my comment below.
Aside: the nixpkgs diff highlights a few instances of commented out destructured params that should be updated to the new formatting style.
| <> pretty bclose | ||
| <> nest (pretty (preTrivia bclose)) | ||
| <> pretty (bclose{preTrivia = []}) |
There was a problem hiding this comment.
I don't really understand this diff, or why we need to handle bclose twice; passing it to nest and then handling it again with preTrivia overridden.
Is preTrivia the indentation? Or perhaps the # prefix of the comment? What's the reason we can't just nest the comment without handling it twice?
EDIT: is blcose the closing brace, and preTrivia its attached comments?
There was a problem hiding this comment.
Exactly. So we're nesting the attached comments and formatting the rest of the token
Love it! Fortunately, the diff looks small enough that I'm not nervous about this being painful to apply to nixpkgs. |
Addresses inconsistent indentation of comments after the last parameter in function parameter lists.
Comments following all parameters were incorrectly indented one level less than comments between parameters.
Fixes #337