module Pollock.DriverPlugin
( ensureHaddockIsOn
) where
import qualified Pollock.CompatGHC as CompatGHC
ensureHaddockIsOn :: [a] -> CompatGHC.HscEnv -> IO CompatGHC.HscEnv
ensureHaddockIsOn :: forall a. [a] -> HscEnv -> IO HscEnv
ensureHaddockIsOn [a]
_ HscEnv
env =
let
dflags :: DynFlags
dflags = HscEnv -> DynFlags
CompatGHC.hsc_dflags HscEnv
env
newDflags :: DynFlags
newDflags =
DynFlags
dflags
{ generalFlags :: EnumSet GeneralFlag
CompatGHC.generalFlags =
GeneralFlag -> EnumSet GeneralFlag -> EnumSet GeneralFlag
forall a. Enum a => a -> EnumSet a -> EnumSet a
CompatGHC.insertEnumSet GeneralFlag
CompatGHC.Opt_Haddock (DynFlags -> EnumSet GeneralFlag
CompatGHC.generalFlags DynFlags
dflags)
}
in
HscEnv -> IO HscEnv
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (HscEnv -> IO HscEnv) -> HscEnv -> IO HscEnv
forall a b. (a -> b) -> a -> b
$
HscEnv
env
{ hsc_dflags :: DynFlags
CompatGHC.hsc_dflags = DynFlags
newDflags
}