summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
Diffstat (limited to 'ghc')
-rw-r--r--ghc/InteractiveUI.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index 9ac3be4773..ab4ea8721b 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -39,7 +39,8 @@ import HscTypes ( tyThingParent_maybe, handleFlagWarnings, getSafeMode, hsc_IC,
setInteractivePrintName )
import Module
import Name
-import Packages ( trusted, getPackageDetails, exposed, exposedModules, pkgIdMap )
+import Packages ( ModuleExport(..), trusted, getPackageDetails, exposed,
+ exposedModules, reexportedModules, pkgIdMap )
import PprTyThing
import RdrName ( getGRE_NameQualifier_maybes )
import SrcLoc
@@ -2544,11 +2545,14 @@ wrapIdentCompleterWithModifier modifChars fun = completeWordWithPrev Nothing wor
where
getModifier = find (`elem` modifChars)
+-- | Return a list of visible module names for autocompletion.
allExposedModules :: DynFlags -> [ModuleName]
allExposedModules dflags
- = concat (map exposedModules (filter exposed (eltsUFM pkg_db)))
+ = concatMap extract (filter exposed (eltsUFM pkg_db))
where
pkg_db = pkgIdMap (pkgState dflags)
+ extract pkg = exposedModules pkg ++ map exportName (reexportedModules pkg)
+ -- Extract the *new* name, because that's what is user visible
completeExpression = completeQuotedWord (Just '\\') "\"" listFiles
completeIdentifier