Make if-then-layout layout more consistent
parent
5bee3fa93d
commit
7c329d391b
|
@ -588,7 +588,7 @@ layoutExpr lexpr@(L _ expr) = do
|
|||
, docForceParSpacing thenExprDoc
|
||||
]
|
||||
, docAddBaseY BrIndentRegular
|
||||
$ docPar (thenDoc) thenExprDoc
|
||||
$ docPar thenDoc thenExprDoc
|
||||
]
|
||||
, docAddBaseY BrIndentRegular $ docNonBottomSpacing $ docAlt
|
||||
[ docSeq
|
||||
|
@ -617,48 +617,30 @@ layoutExpr lexpr@(L _ expr) = do
|
|||
-- else
|
||||
-- stuff
|
||||
-- note that this does _not_ have par-spacing
|
||||
addAlternative $ docAddBaseY BrIndentRegular $ docPar
|
||||
addAlternative $ docPar
|
||||
(docAddBaseY maySpecialIndent $ docSeq
|
||||
[ -- TODO92 docNodeAnnKW lexpr Nothing $
|
||||
appSep $ ifDoc
|
||||
, -- TODO92 docNodeAnnKW lexpr (Just AnnIf) $
|
||||
ifExprDoc
|
||||
[ appSep $ ifDoc
|
||||
, ifExprDoc
|
||||
]
|
||||
)
|
||||
(docLines
|
||||
[ docAddBaseY BrIndentRegular
|
||||
-- TODO92 $ docNodeAnnKW lexpr (Just AnnThen)
|
||||
$ docAlt
|
||||
[ docSeq
|
||||
[ appSep $ thenDoc
|
||||
, docForceParSpacing thenExprDoc
|
||||
]
|
||||
, docAddBaseY BrIndentRegular
|
||||
$ docPar (thenDoc) thenExprDoc
|
||||
, docPar thenDoc thenExprDoc
|
||||
]
|
||||
, docAddBaseY BrIndentRegular $ docAlt
|
||||
[ docSeq
|
||||
[ appSep $ elseDoc
|
||||
, docForceParSpacing elseExprDoc
|
||||
]
|
||||
, docAddBaseY BrIndentRegular
|
||||
$ docPar elseDoc elseExprDoc
|
||||
, docPar elseDoc elseExprDoc
|
||||
]
|
||||
]
|
||||
)
|
||||
addAlternative $ docSetBaseY $ docLines
|
||||
[ docAddBaseY maySpecialIndent $ docSeq
|
||||
[ -- TODO92 docNodeAnnKW lexpr Nothing $
|
||||
appSep $ ifDoc
|
||||
, -- TODO92 docNodeAnnKW lexpr (Just AnnIf) $
|
||||
ifExprDoc
|
||||
]
|
||||
, -- TODO92 docNodeAnnKW lexpr (Just AnnThen) $
|
||||
docAddBaseY BrIndentRegular
|
||||
$ docPar (thenDoc) thenExprDoc
|
||||
, docAddBaseY BrIndentRegular
|
||||
$ docPar elseDoc elseExprDoc
|
||||
]
|
||||
HsMultiIf epAnn cases -> do
|
||||
binderDoc <- docLit $ Text.pack "->"
|
||||
let hasComments =
|
||||
|
|
Loading…
Reference in New Issue