summaryrefslogtreecommitdiff
path: root/ghc/GHCi/UI/Info.hs
diff options
context:
space:
mode:
Diffstat (limited to 'ghc/GHCi/UI/Info.hs')
-rw-r--r--ghc/GHCi/UI/Info.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/ghc/GHCi/UI/Info.hs b/ghc/GHCi/UI/Info.hs
index 64db8ea219..e6cf0838ca 100644
--- a/ghc/GHCi/UI/Info.hs
+++ b/ghc/GHCi/UI/Info.hs
@@ -40,6 +40,7 @@ import GHC.Driver.Session (HasDynFlags(..))
import GHC.Data.FastString
import GHC
import GHC.Driver.Monad
+import GHC.Driver.Env
import GHC.Driver.Ppr
import GHC.Types.Name
import GHC.Types.Name.Set
@@ -264,6 +265,7 @@ collectInfo :: (GhcMonad m) => Map ModuleName ModInfo -> [ModuleName]
-> m (Map ModuleName ModInfo)
collectInfo ms loaded = do
df <- getDynFlags
+ unit_state <- hsc_units <$> getSession
liftIO (filterM cacheInvalid loaded) >>= \case
[] -> return ms
invalidated -> do
@@ -271,13 +273,13 @@ collectInfo ms loaded = do
show (length invalidated) ++
" module(s) ... "))
- foldM (go df) ms invalidated
+ foldM (go df unit_state) ms invalidated
where
- go df m name = do { info <- getModInfo name; return (M.insert name info m) }
+ go df unit_state m name = do { info <- getModInfo name; return (M.insert name info m) }
`MC.catch`
(\(e :: SomeException) -> do
liftIO $ putStrLn
- $ showSDocForUser df alwaysQualify
+ $ showSDocForUser df unit_state alwaysQualify
$ "Error while getting type info from" <+>
ppr name <> ":" <+> text (show e)
return m)