on master help sign in
Fix moving comments before module header into the export list
647e322mrkkrp
CHANGELOG.md+4
@@ -6,6 +6,10 @@
6* Fixed a minor inconsistency between formatting of normal and foreign type
6* Fixed a minor inconsistency between formatting of normal and foreign type
7 signatures. See [issue 408](https://github.com/tweag/ormolu/issues/408).
7 signatures. See [issue 408](https://github.com/tweag/ormolu/issues/408).
8
8
9+* Fixed a bug when comment before module header with Haddock was moved
10+ inside the export list. See [issue
11+ 430](https://github.com/tweag/ormolu/issues/430).
12+
9## Ormolu 0.0.1.0
13## Ormolu 0.0.1.0
10
14
11* Initial release.
15* Initial release.
data/examples/module-header/preceding-comment-with-haddock-out.hsnew file+11
@@ -0,0 +1,11 @@
1+{-
2+ Here we go.
3+-}
4+
5+-- | This is the module's Haddock.
6+module Main
7+ ( main,
8+ )
9+where
10+
11+main = return ()
data/examples/module-header/preceding-comment-with-haddock.hsnew file+8
@@ -0,0 +1,8 @@
1+{-
2+ Here we go.
3+-}
4+
5+-- | This is the module's Haddock.
6+module Main (main) where
7+
8+main = return ()
src/Ormolu/Printer/Meat/Module.hs+3−2
@@ -31,11 +31,12 @@ p_hsModule pragmas (L moduleSpan HsModule {..}) = do
31 switchLayout spans' $ do
31 switchLayout spans' $ do
32 p_pragmas pragmas
32 p_pragmas pragmas
33 newline
33 newline
34− forM_ hsmodHaddockModHeader (p_hsDocString Pipe True)
35 case hsmodName of
34 case hsmodName of
36 Nothing -> return ()
35 Nothing -> return ()
37 Just hsmodName' -> do
36 Just hsmodName' -> do
38− located hsmodName' p_hsmodName
37+ located hsmodName' $ \name -> do
38+ forM_ hsmodHaddockModHeader (p_hsDocString Pipe True)
39+ p_hsmodName name
39 forM_ hsmodDeprecMessage $ \w -> do
40 forM_ hsmodDeprecMessage $ \w -> do
40 breakpoint
41 breakpoint
41 located' p_moduleWarning w
42 located' p_moduleWarning w