Fix let-in-expr non-idempotent comment placement
parent
15fc8ec332
commit
7d84705e7a
|
@ -1113,3 +1113,16 @@ func = do
|
|||
func arg = abc ++ def ++ case arg of
|
||||
False -> ghi
|
||||
True -> jkl
|
||||
|
||||
#test non-idempotent comment position with let-in-where
|
||||
otherFunc very long patterrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrn
|
||||
= let
|
||||
localfunc a b c = a <> b <> c
|
||||
someThing = fromList [abc, def, ghi]
|
||||
in -- abc
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
||||
+ ccccccc
|
||||
where
|
||||
ccccccc = "abc"
|
||||
ddddd = True
|
||||
|
|
|
@ -553,10 +553,11 @@ layoutExpr lexpr@(L _ expr) = do
|
|||
]
|
||||
, docAlt
|
||||
[ docSeq
|
||||
[ appSep $ wrapIn $ docLit $ Text.pack $ ifIndentFreeElse
|
||||
"in "
|
||||
"in"
|
||||
, ifIndentFreeElse docSetBaseAndIndent
|
||||
[ appSep $ wrapIn $ docLit $ Text.pack "in"
|
||||
, ifIndentFreeElse ( docSetBaseAndIndent
|
||||
. docEnsureIndent (BrIndentSpecial 1)
|
||||
. docSetBaseAndIndent
|
||||
)
|
||||
docForceSingleline
|
||||
expDoc1
|
||||
]
|
||||
|
@ -585,7 +586,8 @@ layoutExpr lexpr@(L _ expr) = do
|
|||
$ docSetBaseAndIndent $ docLines $ pure <$> bindDocs
|
||||
)
|
||||
, docSeq
|
||||
[ wrapIn $ docLit $ Text.pack "in "
|
||||
[ wrapIn $ docLit $ Text.pack "in"
|
||||
, docSeparator
|
||||
, docAddBaseY BrIndentRegular $ docForceParSpacing expDoc1
|
||||
]
|
||||
]
|
||||
|
@ -598,8 +600,10 @@ layoutExpr lexpr@(L _ expr) = do
|
|||
, wrapBinds $ docSetBaseAndIndent $ docLines $ pure <$> bindDocs
|
||||
]
|
||||
, docSeq
|
||||
[ appSep $ wrapIn $ docLit $ Text.pack "in "
|
||||
, docSetBaseY expDoc1
|
||||
[ appSep $ wrapIn $ docLit $ Text.pack "in"
|
||||
, docSetBaseY
|
||||
$ docEnsureIndent (BrIndentSpecial 1)
|
||||
$ docSetBaseY expDoc1
|
||||
]
|
||||
]
|
||||
addAlternative $ docLines
|
||||
|
|
|
@ -143,7 +143,7 @@ layoutWriteComment absolute isBlock dp commentLines s = do
|
|||
' '
|
||||
mTell $ Text.Builder.fromText s
|
||||
traceLocal
|
||||
( "layoutMoveToCommentPos"
|
||||
( "layoutWriteComment"
|
||||
, y
|
||||
, x
|
||||
, commentLines
|
||||
|
|
Loading…
Reference in New Issue