Remove dependency on 'pretty'

Now using GHC's 'Pretty' module instead
This commit is contained in:
Daniel Gröber
2016-12-13 01:40:05 +01:00
parent e32cb977b7
commit 5d3e5932a7
11 changed files with 26 additions and 17 deletions

View File

@@ -20,15 +20,24 @@ import Control.Arrow hiding ((<+>))
import Data.Char
import Data.List
import Distribution.Helper
import Text.PrettyPrint
import Pretty
import GHC
import Outputable (SDoc, withPprStyleDoc)
import Language.Haskell.GhcMod.Types
import Language.Haskell.GhcMod.Doc
docStyle :: Style
docStyle = style { ribbonsPerLine = 1.2 }
gmRenderDoc :: Doc -> String
gmRenderDoc = renderStyle docStyle
render :: Doc -> String
render = renderStyle docStyle
renderSDoc :: GhcMonad m => SDoc -> m Doc
renderSDoc sdoc = do
df <- getSessionDynFlags
ppsty <- getStyle
return $ withPprStyleDoc df ppsty sdoc
gmComponentNameDoc :: ChComponentName -> Doc
gmComponentNameDoc ChSetupHsName = text $ "Setup.hs"