@@ -33,7 +33,7 @@ import Idris.Output
33import Idris.Interactive
33import Idris.Interactive
34import Idris.WhoCalls
34import Idris.WhoCalls
35import Idris.TypeSearch (searchByType)
35import Idris.TypeSearch (searchByType)
36−import Idris.IBC (writePkgIndex)
36+import Idris.IBC (loadPkgIndex, writePkgIndex)
38import Idris.Elab.Type
38import Idris.Elab.Type
39import Idris.Elab.Clause
39import Idris.Elab.Clause
@@ -356,7 +356,7 @@ runIdeSlaveCommand h id orig fn mods (IdeSlave.MakeLemma line name) =
356 Left err -> iPrintError err
356 Left err -> iPrintError err
357 Right n -> process fn (MakeLemma False line n)
357 Right n -> process fn (MakeLemma False line n)
358runIdeSlaveCommand h id orig fn mods (IdeSlave.Apropos a) =
358runIdeSlaveCommand h id orig fn mods (IdeSlave.Apropos a) =
359− process fn (Apropos a)
359+ process fn (Apropos [] a)
360runIdeSlaveCommand h id orig fn mods (IdeSlave.GetOpts) =
360runIdeSlaveCommand h id orig fn mods (IdeSlave.GetOpts) =
361 do ist <- getIState
361 do ist <- getIState
362 let opts = idris_options ist
362 let opts = idris_options ist
@@ -584,8 +584,8 @@ ideslaveProcess fn (MakeWith False pos str) = process fn (MakeWith False pos str
584ideslaveProcess fn (DoProofSearch False r pos str xs) = process fn (DoProofSearch False r pos str xs)
584ideslaveProcess fn (DoProofSearch False r pos str xs) = process fn (DoProofSearch False r pos str xs)
585ideslaveProcess fn (SetConsoleWidth w) = do process fn (SetConsoleWidth w)
585ideslaveProcess fn (SetConsoleWidth w) = do process fn (SetConsoleWidth w)
586 iPrintResult ""
586 iPrintResult ""
587−ideslaveProcess fn (Apropos a) = do process fn (Apropos a)
587+ideslaveProcess fn (Apropos pkg a) = do process fn (Apropos pkg a)
588− iPrintResult ""
588+ iPrintResult ""
589ideslaveProcess fn (WhoCalls n) = process fn (WhoCalls n)
589ideslaveProcess fn (WhoCalls n) = process fn (WhoCalls n)
590ideslaveProcess fn (CallsWho n) = process fn (CallsWho n)
590ideslaveProcess fn (CallsWho n) = process fn (CallsWho n)
591ideslaveProcess fn (PrintDef n) = process fn (PrintDef n)
591ideslaveProcess fn (PrintDef n) = process fn (PrintDef n)
@@ -1164,14 +1164,19 @@ process fn ListErrorHandlers =
1164 handlers -> "Registered error handlers: " ++ (concat . intersperse ", " . map show) handlers
1164 handlers -> "Registered error handlers: " ++ (concat . intersperse ", " . map show) handlers
1165process fn (SetConsoleWidth w) = setWidth w
1165process fn (SetConsoleWidth w) = setWidth w
1167−process fn (Apropos a) =
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
1168− do ist <- getIState
1172+ ist <- getIState
1169 let names = apropos ist (T.pack a)
1173 let names = apropos ist (T.pack a)
1170 let aproposInfo = [ (n,
1174 let aproposInfo = [ (n,
1171 delabTy ist n,
1175 delabTy ist n,
1172 fmap (overview . fst) (lookupCtxtExact n (idris_docstrings ist)))
1176 fmap (overview . fst) (lookupCtxtExact n (idris_docstrings ist)))
1173 | n <- sort names, isUN n ]
1177 | n <- sort names, isUN n ]
1174 iRenderResult $ vsep (map (prettyDocumentedIst ist) aproposInfo)
1178 iRenderResult $ vsep (map (prettyDocumentedIst ist) aproposInfo)
1175 where isUN (UN _) = True
1180 where isUN (UN _) = True
1176 isUN (NS n _) = isUN n
1181 isUN (NS n _) = isUN n
1177 isUN _ = False
1182 isUN _ = False