Merge pull request #215 from matt-noonan/multiline-app-with-comments

Disable single-line HsApp with argument comments.
pull/222/head^2
Lennart Spitzner 2019-06-05 21:06:02 +02:00 committed by GitHub
commit 4f2673a2eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -650,3 +650,13 @@ jaicyhHumzo btrKpeyiFej mava = do
)
Xcde{} -> (s, Pioemav)
pure imomue
#test issue 214
-- brittany { lconfig_indentPolicy: IndentPolicyMultiple }
foo = bar
arg1 -- this is the first argument
arg2 -- this is the second argument
arg3 -- this is the third argument, now I'll skip one comment
arg4
arg5 -- this is the fifth argument
arg6 -- this is the sixth argument

View File

@ -172,9 +172,10 @@ layoutExpr lexpr@(L _ expr) = do
_ -> docSeq
headDoc <- docSharedWrapper layoutExpr headE
paramDocs <- docSharedWrapper layoutExpr `mapM` paramEs
hasComments <- hasAnyCommentsConnected exp2
runFilteredAlternative $ do
-- foo x y
addAlternative
addAlternativeCond (not hasComments)
$ colsOrSequence
$ appSep (docForceSingleline headDoc)
: spacifyDocs (docForceSingleline <$> paramDocs)