X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FInteractiveUI.hs;h=e5c6813234834eae0fc6543bcafec4441a265d28;hb=aafdba3bce91afb003f5f50e001e141744837bae;hp=f792acca5e24d9720bc1bb76c6d7547264342154;hpb=037aa382bad090cf5d39fbfdf00a6634be69ddc4;p=ghc-hetmet.git diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index f792acc..e5c6813 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -167,8 +167,8 @@ helpText = " evaluate/run \n" ++ " :{\\n ..lines.. \\n:}\\n multiline command\n" ++ " :add ... add module(s) to the current target set\n" ++ - " :browse[!] [-s] [[*]] display the names defined by module \n" ++ - " (!: more details; -s: sort; *: all top-level names)\n" ++ + " :browse[!] [[*]] display the names defined by module \n" ++ + " (!: more details; *: all top-level names)\n" ++ " :cd change directory to \n" ++ " :cmd run the commands returned by ::IO String\n" ++ " :ctags [] create tags file for Vi (default: \"tags\")\n" ++ @@ -1171,15 +1171,19 @@ browseCmd bang m = browseModule :: Bool -> Module -> Bool -> GHCi () browseModule bang modl exports_only = do s <- getSession + -- :browse! reports qualifiers wrt current context + current_unqual <- io (GHC.getPrintUnqual s) -- Temporarily set the context to the module we're interested in, -- just so we can get an appropriate PrintUnqualified (as,bs) <- io (GHC.getContext s) prel_mod <- getPrelude io (if exports_only then GHC.setContext s [] [prel_mod,modl] else GHC.setContext s [modl] []) - unqual <- io (GHC.getPrintUnqual s) + target_unqual <- io (GHC.getPrintUnqual s) io (GHC.setContext s as bs) + let unqual = if bang then current_unqual else target_unqual + mb_mod_info <- io $ GHC.getModuleInfo s modl case mb_mod_info of Nothing -> throwDyn (CmdLineError ("unknown module: " ++ @@ -1220,7 +1224,7 @@ browseModule bang modl exports_only = do labels [] = text "-- not currently imported" labels l = text $ intercalate "\n" $ map qualifier l qualifier = maybe "-- defined locally" - (("-- imported from "++) . intercalate ", " + (("-- imported via "++) . intercalate ", " . map GHC.moduleNameString) importInfo = RdrName.getGRE_NameQualifier_maybes rdr_env modNames = map (importInfo . GHC.getName) things