diff options
| author | Matthew Pickering <matthewtpickering@gmail.com> | 2018-08-21 08:34:50 +0100 | 
|---|---|---|
| committer | Ben Gamari <ben@smart-cactus.org> | 2018-08-21 19:12:39 -0400 | 
| commit | 3902a807acf4bccf5cd01d2115bed10d57316661 (patch) | |
| tree | 12cdc2a48d3f55ff6b6bf521f98e3dc04977f87b /haddock-api/src | |
| parent | 40eb5aabed0ae52982a690be311177b2dea2a0bb (diff) | |
Load plugins when starting a GHC session (#905)
Fixes #900
(cherry picked from commit e6aa8fb47b9477cc5ef5e46097524fe83e080f6d)
Diffstat (limited to 'haddock-api/src')
| -rw-r--r-- | haddock-api/src/Haddock.hs | 6 | 
1 files changed, 5 insertions, 1 deletions
| diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index 00eb50f6..86a65901 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 @@ -437,7 +438,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" | 
