ghc-mod/core/GhcMod/Doc.hs

21 lines
590 B
Haskell
Raw Normal View History

module GhcMod.Doc where
2013-03-12 13:15:23 +00:00
import GHC
import GhcMod.Gap (withStyle, showDocWith)
import Outputable
import Pretty (Mode(..))
2013-03-12 13:15:23 +00:00
showPage :: DynFlags -> PprStyle -> SDoc -> String
showPage dflag style = showDocWith dflag PageMode . withStyle dflag style
2013-07-14 08:07:30 +00:00
showOneLine :: DynFlags -> PprStyle -> SDoc -> String
showOneLine dflag style = showDocWith dflag OneLineMode . withStyle dflag style
2013-07-14 08:07:30 +00:00
getStyle :: GhcMonad m => m PprStyle
getStyle = do
unqual <- getPrintUnqual
return $ mkUserStyle unqual AllTheWay
2013-03-12 13:15:23 +00:00
2013-07-14 08:07:30 +00:00
styleUnqualified :: PprStyle
styleUnqualified = mkUserStyle neverQualify AllTheWay