Commit 19e23dce authored by Simon Peyton Jones's avatar Simon Peyton Jones

A little refactoring so that we print package-qualified modules names if necessary

parent 0ec53020
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment