diff options
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/InteractiveUI.hs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index 537581215c..1476f95add 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -1374,8 +1374,7 @@ afterLoad ok retain_context = do lift discardTickArrays loaded_mod_summaries <- getLoadedModules let loaded_mods = map GHC.ms_mod loaded_mod_summaries - loaded_mod_names = map GHC.moduleName loaded_mods - modulesLoadedMsg ok loaded_mod_names + modulesLoadedMsg ok loaded_mods lift $ setContextAfterLoad retain_context loaded_mod_summaries @@ -1448,20 +1447,22 @@ keepPackageImports = filterM is_pkg_import mod_name = unLoc (ideclName d) -modulesLoadedMsg :: SuccessFlag -> [ModuleName] -> InputT GHCi () +modulesLoadedMsg :: SuccessFlag -> [Module] -> InputT GHCi () modulesLoadedMsg ok mods = do dflags <- getDynFlags - when (verbosity dflags > 0) $ do - let mod_commas + unqual <- GHC.getPrintUnqual + let mod_commas | null mods = text "none." | otherwise = hsep ( punctuate comma (map ppr mods)) <> text "." - case ok of - Failed -> - liftIO $ putStrLn $ showSDoc dflags (text "Failed, modules loaded: " <> mod_commas) - Succeeded -> - liftIO $ putStrLn $ showSDoc dflags (text "Ok, modules loaded: " <> mod_commas) + status = case ok of + Failed -> text "Failed" + Succeeded -> text "Ok" + + msg = status <> text ", modules loaded:" <+> mod_commas + when (verbosity dflags > 0) $ + liftIO $ putStrLn $ showSDocForUser dflags unqual msg ----------------------------------------------------------------------------- -- :type |