From: Simon Marlow Date: Thu, 26 Apr 2007 08:39:02 +0000 (+0000) Subject: getRdrNamesInScope: return interactively-bound names too X-Git-Tag: 2007-05-06~94 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=cf997f8083f529e71bb4b5030eb9fc8cf0aaa7f7 getRdrNamesInScope: return interactively-bound names too so completion can now complete names of local bindings --- diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index f8402f8..f1ab876 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -2037,8 +2037,15 @@ getNamesInScope s = withSession s $ \hsc_env -> do getRdrNamesInScope :: Session -> IO [RdrName] getRdrNamesInScope s = withSession s $ \hsc_env -> do - let env = ic_rn_gbl_env (hsc_IC hsc_env) - return (concat (map greToRdrNames (globalRdrEnvElts env))) + let + ic = hsc_IC hsc_env + gbl_rdrenv = ic_rn_gbl_env ic + ids = typeEnvIds (ic_type_env ic) + gbl_names = concat (map greToRdrNames (globalRdrEnvElts gbl_rdrenv)) + lcl_names = map (mkRdrUnqual.nameOccName.idName) ids + -- + return (gbl_names ++ lcl_names) + -- ToDo: move to RdrName greToRdrNames :: GlobalRdrElt -> [RdrName]