File tree Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 99* Format parenthesized operators starting with a ` # ` correctly in the presence
1010 of ` UnboxedSums ` . [ Issue 1062] ( https://github.com/tweag/ormolu/issues/1062 ) .
1111
12+ * Fix false positives in AST diffing related to empty Haddock comments in data
13+ declarations. [ Issue 1065] ( https://github.com/tweag/ormolu/issues/1065 ) .
14+
1215## Ormolu 0.7.1.0
1316
1417* Include ` base ` fixity information when formatting a Haskell file that's
Original file line number Diff line number Diff line change 55
66test ::
77 test
8+
9+ data T = T
Original file line number Diff line number Diff line change 99test ::
1010 -- |
1111 test
12+
13+ data T = T {- ^ -}
Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ parseModuleSnippet Config {..} modFixityMap dynFlags path rawInput = liftIO $ do
177177normalizeModule :: HsModule GhcPs -> HsModule GhcPs
178178normalizeModule hsmod =
179179 everywhere
180- (extT ( mkT dropBlankTypeHaddocks) patchContext)
180+ (mkT dropBlankTypeHaddocks `extT` dropBlankDataDeclHaddocks `extT` patchContext)
181181 hsmod
182182 { hsmodImports =
183183 normalizeImports (hsmodImports hsmod),
@@ -204,6 +204,13 @@ normalizeModule hsmod =
204204 L _ (HsDocTy _ ty s) :: LHsType GhcPs
205205 | isBlankDocString s -> ty
206206 a -> a
207+ dropBlankDataDeclHaddocks = \ case
208+ ConDeclGADT {con_doc = Just s, .. } :: ConDecl GhcPs
209+ | isBlankDocString s -> ConDeclGADT {con_doc = Nothing , .. }
210+ ConDeclH98 {con_doc = Just s, .. } :: ConDecl GhcPs
211+ | isBlankDocString s -> ConDeclH98 {con_doc = Nothing , .. }
212+ a -> a
213+
207214 patchContext :: LHsContext GhcPs -> LHsContext GhcPs
208215 patchContext = fmap $ \ case
209216 [x@ (L _ (HsParTy _ _))] -> [x]
You can’t perform that action at this time.
0 commit comments