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
{ CompatGHC.generalFlags =
CompatGHC.insertEnumSet CompatGHC.Opt_Haddock (CompatGHC.generalFlags 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
{ CompatGHC.hsc_dflags = newDflags
}