1module Development.IDE.Plugin.CodeAction.Rules
6import Data.HashMap.Strict ( fromListWith )
10import Data.Traversable ( forM )
11import Development.IDE.Core.Rules
12import Development.IDE.GHC.Util
13import Development.IDE.Plugin.CodeAction.RuleTypes
14import Development.Shake
15import GHC ( DynFlags(pkgState) )
16import HscTypes ( IfaceExport
22import Module ( Module(..)
26import Packages ( explicitPackages
30import TcRnMonad ( WhereFrom(ImportByUser)
34rulePackageExports :: Rules ()
35rulePackageExports = defineNoFile $ \(PackageExports session) -> do
36 let env = hscEnv session
37 pkgst = pkgState (hsc_dflags env)
38 depends = explicitPackages pkgst
42 , Just pkg <- [lookupPackageConfig d env]
43 , (mn, _) <- exposedModules pkg
46 results <- forM targets $ \(pkg, mn) -> do
47 modIface <- liftIO $ initIfaceLoad env $ loadInterface
49 (Module (packageConfigId pkg) mn)
52 Failed _err -> return mempty
54 let avails = mi_exports mi
55 return $ concatMap (unpackAvail mn) avails
56 return $ fromListWith (++) $ concat results
58unpackAvail :: ModuleName -> IfaceExport -> [(Text, [(IdentInfo, Text)])]
60 map (\id@IdentInfo {..} -> (name, [(id, pack $ moduleNameString mod)]))
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list