From cf997f8083f529e71bb4b5030eb9fc8cf0aaa7f7 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Thu, 26 Apr 2007 08:39:02 +0000 Subject: [PATCH] getRdrNamesInScope: return interactively-bound names too so completion can now complete names of local bindings --- compiler/main/GHC.hs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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] -- 1.7.10.4