aboutsummaryrefslogtreecommitdiff
path: root/haddock-api
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2018-08-21 08:34:50 +0100
committerAlexander Biehl <alexbiehl@gmail.com>2018-08-21 09:34:50 +0200
commit72d82e52f2a6225686d9668790ac33c1d1743193 (patch)
treee9a2229e5a5c60fe8d0ac930817586783678a891 /haddock-api
parentc9d918de8944fb89e11cf182501e9846ff4316e7 (diff)
Load plugins when starting a GHC session (#905)
Fixes #900
Diffstat (limited to 'haddock-api')
-rw-r--r--haddock-api/src/Haddock.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs
index 40da7ceb..d294b612 100644
--- a/haddock-api/src/Haddock.hs
+++ b/haddock-api/src/Haddock.hs
@@ -75,6 +75,7 @@ import Packages
import Panic (handleGhcException)
import Module
import FastString
+import qualified DynamicLoading
--------------------------------------------------------------------------------
-- * Exception handling
@@ -448,7 +449,10 @@ withGhc' libDir flags ghcActs = runGhc (Just libDir) $ do
-- that may need to be re-linked: Haddock doesn't do any
-- dynamic or static linking at all!
_ <- setSessionDynFlags dynflags''
- ghcActs dynflags''
+ hscenv <- GHC.getSession
+ dynflags''' <- liftIO (DynamicLoading.initializePlugins hscenv dynflags'')
+ _ <- setSessionDynFlags dynflags'''
+ ghcActs dynflags'''
where
-- ignore sublists of flags that start with "+RTS" and end in "-RTS"