summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2014-09-15 13:14:30 -0700
committerEdward Z. Yang <ezyang@cs.stanford.edu>2014-09-15 13:15:15 -0700
commitb72478f41b85337b84edab8f625d103e197f116c (patch)
treee0ab347d2885067bdf6a0964304f2e9f3cd9e4a9 /compiler
parent65f887e1a0d864526f6a2609a3afc2c151c25e38 (diff)
downloadhaskell-b72478f41b85337b84edab8f625d103e197f116c.tar.gz
Don't offer hidden modules for autocomplete.
It was annoying to test GHCi directly, so I added a ghc-api unit test of the function instead. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Diffstat (limited to 'compiler')
-rw-r--r--compiler/main/Packages.lhs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/main/Packages.lhs b/compiler/main/Packages.lhs
index c14c8cf7f8..a6a61e9534 100644
--- a/compiler/main/Packages.lhs
+++ b/compiler/main/Packages.lhs
@@ -1304,7 +1304,8 @@ lookupModuleWithSuggestions dflags m mb_pn
listVisibleModuleNames :: DynFlags -> [ModuleName]
listVisibleModuleNames dflags =
- Map.keys (moduleToPkgConfAll (pkgState dflags))
+ map fst (filter visible (Map.toList (moduleToPkgConfAll (pkgState dflags))))
+ where visible (_, ms) = any originVisible (Map.elems ms)
-- | Find all the 'PackageConfig' in both the preload packages from 'DynFlags' and corresponding to the list of
-- 'PackageConfig's