Correctly format when adding annotations to types
commitb3f6e1b4f61bdd2907cd396edaac8157fe68595b
authorUtku Demir <me@utdemir.com>
dateWed 14 Aug 2019, 18:19 (7 years ago)
parentf55021d
data/examples/declaration/annotation/annotation-out.hs+1
@@ -17,4 +17,5 @@ foo = 5
1717 #-}
1818
1919data Foo = Foo Int
20+{-# ANN type Foo ("HLint: ignore") #-}
2021{- Comment -}
data/examples/declaration/annotation/annotation.hs+2
@@ -15,4 +15,6 @@ foo = 5
1515
1616data Foo = Foo Int
1717
18+{-# ANN type Foo ("HLint: ignore") #-}
19+
1820{- Comment -}
src/Ormolu/Printer/Meat/Declaration/Annotation.hs+1−1
@@ -23,5 +23,5 @@ p_annDecl = \case
2323p_annProv :: AnnProvenance (IdP GhcPs) -> R ()
2424p_annProv = \case
2525 ValueAnnProvenance name -> p_rdrName name
26− TypeAnnProvenance name -> p_rdrName name
26+ TypeAnnProvenance name -> txt "type " >> p_rdrName name
2727 ModuleAnnProvenance -> txt "module"