Fix a missing comment case with MultiWayIf
parent
03e578f72c
commit
4ed3a2f53d
|
@ -14,3 +14,10 @@ func = do
|
|||
bar $ if
|
||||
| cond1 -> loooooooooooooooooooooooooooooong expr1
|
||||
| cond2 -> loooooooooooooooooooooooooooooong expr2
|
||||
|
||||
#test multiwayif comment between cases
|
||||
func = do
|
||||
if
|
||||
| abc -> yes
|
||||
-- | test comment
|
||||
| _ -> no
|
||||
|
|
|
@ -493,16 +493,19 @@ layoutExpr lexpr@(L _ expr) = do
|
|||
|| any (\(L _ (GRHS gEpAnn _ _)) -> hasAnyCommentsBelow gEpAnn) cases
|
||||
let posIf = obtainAnnPos epAnn AnnIf
|
||||
layouters <- mAsk
|
||||
docSetParSpacing $ docAddBaseY BrIndentRegular $ docPar
|
||||
(docHandleComms posIf $ docLit $ Text.pack "if")
|
||||
(layout_patternBindFinal layouters
|
||||
Nothing
|
||||
binderDoc
|
||||
Nothing
|
||||
(Right cases)
|
||||
(id, Nothing)
|
||||
hasComments
|
||||
)
|
||||
docHandleComms epAnn
|
||||
$ docSetParSpacing
|
||||
$ docAddBaseY BrIndentRegular
|
||||
$ docPar
|
||||
(docHandleComms posIf $ docLit $ Text.pack "if")
|
||||
(layout_patternBindFinal layouters
|
||||
Nothing
|
||||
binderDoc
|
||||
Nothing
|
||||
(Right cases)
|
||||
(id, Nothing)
|
||||
hasComments
|
||||
)
|
||||
HsLet epAnn binds exp1 -> docHandleComms epAnn $ do
|
||||
let AnnsLet spanLet spanIn = anns epAnn
|
||||
let hasComments = hasAnyCommentsBelow lexpr
|
||||
|
|
Loading…
Reference in New Issue