Commit cf997f80 authored by Simon Marlow's avatar Simon Marlow
Browse files

getRdrNamesInScope: return interactively-bound names too

so completion can now complete names of local bindings
parent 095be20c
...@@ -2037,8 +2037,15 @@ getNamesInScope s = withSession s $ \hsc_env -> do ...@@ -2037,8 +2037,15 @@ getNamesInScope s = withSession s $ \hsc_env -> do
getRdrNamesInScope :: Session -> IO [RdrName] getRdrNamesInScope :: Session -> IO [RdrName]
getRdrNamesInScope s = withSession s $ \hsc_env -> do getRdrNamesInScope s = withSession s $ \hsc_env -> do
let env = ic_rn_gbl_env (hsc_IC hsc_env) let
return (concat (map greToRdrNames (globalRdrEnvElts env))) 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 -- ToDo: move to RdrName
greToRdrNames :: GlobalRdrElt -> [RdrName] greToRdrNames :: GlobalRdrElt -> [RdrName]
......
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