@@ -33,7 +33,7 @@ import Idris.Output
3333import Idris.Interactive
3434import Idris.WhoCalls
3535import Idris.TypeSearch (searchByType)
36−import Idris.IBC (writePkgIndex)
36+import Idris.IBC (loadPkgIndex, writePkgIndex)
3737
3838import Idris.Elab.Type
3939import Idris.Elab.Clause
@@ -356,7 +356,7 @@ runIdeSlaveCommand h id orig fn mods (IdeSlave.MakeLemma line name) =
356356 Left err -> iPrintError err
357357 Right n -> process fn (MakeLemma False line n)
358358runIdeSlaveCommand h id orig fn mods (IdeSlave.Apropos a) =
359− process fn (Apropos a)
359+ process fn (Apropos [] a)
360360runIdeSlaveCommand h id orig fn mods (IdeSlave.GetOpts) =
361361 do ist <- getIState
362362 let opts = idris_options ist
@@ -584,8 +584,8 @@ ideslaveProcess fn (MakeWith False pos str) = process fn (MakeWith False pos str
584584ideslaveProcess fn (DoProofSearch False r pos str xs) = process fn (DoProofSearch False r pos str xs)
585585ideslaveProcess fn (SetConsoleWidth w) = do process fn (SetConsoleWidth w)
586586 iPrintResult ""
587−ideslaveProcess fn (Apropos a) = do process fn (Apropos a)
588− iPrintResult ""
587+ideslaveProcess fn (Apropos pkg a) = do process fn (Apropos pkg a)
588+ iPrintResult ""
589589ideslaveProcess fn (WhoCalls n) = process fn (WhoCalls n)
590590ideslaveProcess fn (CallsWho n) = process fn (CallsWho n)
591591ideslaveProcess fn (PrintDef n) = process fn (PrintDef n)
@@ -1164,14 +1164,19 @@ process fn ListErrorHandlers =
11641164 handlers -> "Registered error handlers: " ++ (concat . intersperse ", " . map show) handlers
11651165process fn (SetConsoleWidth w) = setWidth w
11661166
1167−process fn (Apropos a) =
1168− do ist <- getIState
1167+process fn (Apropos pkgs a) =
1168+ do orig <- getIState
1169+ when (not (null pkgs)) $
1170+ iputStrLn $ "Searching packages: " ++ showSep ", " pkgs
1171+ mapM_ loadPkgIndex pkgs
1172+ ist <- getIState
11691173 let names = apropos ist (T.pack a)
11701174 let aproposInfo = [ (n,
11711175 delabTy ist n,
11721176 fmap (overview . fst) (lookupCtxtExact n (idris_docstrings ist)))
11731177 | n <- sort names, isUN n ]
11741178 iRenderResult $ vsep (map (prettyDocumentedIst ist) aproposInfo)
1179+ putIState orig
11751180 where isUN (UN _) = True
11761181 isUN (NS n _) = isUN n
11771182 isUN _ = False