Skip to content

Commit d9e1de2

Browse files
committed
Fix remaining failures
1 parent 47908bf commit d9e1de2

File tree

1 file changed

+4
-2
lines changed
  • lib/Language/Haskell/Stylish/Step

1 file changed

+4
-2
lines changed

lib/Language/Haskell/Stylish/Step/Data.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import Language.Haskell.Stylish.Ordering
3737
import Language.Haskell.Stylish.Printer
3838
import Language.Haskell.Stylish.Step
3939
import Language.Haskell.Stylish.Util
40-
4140
--------------------------------------------------------------------------------
4241
data Indent
4342
= SameLine
@@ -140,7 +139,10 @@ putDataDecl cfg@Config {..} decl = do
140139
constructorComments = commentGroups
141140
(GHC.srcSpanToRealSrcSpan . GHC.getLocA)
142141
(getConDecls defn)
143-
(dataComments decl)
142+
(removeCommentsBeforeDataDecl $ dataComments decl)
143+
144+
removeCommentsBeforeDataDecl = filter
145+
(\comment -> GHC.anchor (GHC.getLoc comment) >= dataLoc decl)
144146

145147
onelineEnum =
146148
isEnum decl && not cBreakEnums &&

0 commit comments

Comments
 (0)