@@ -30,7 +30,7 @@ import Idris.Core.Unify (match_unify)
30import Idris.Delaborate (delabTy)
30import Idris.Delaborate (delabTy)
31import Idris.Docstrings (noDocs, overview)
31import Idris.Docstrings (noDocs, overview)
32import Idris.Elab.Type (elabType)
32import Idris.Elab.Type (elabType)
33−import Idris.Output (iputStrLn, iRenderOutput, iPrintResult, iRenderResult, prettyDocumentedIst)
33+import Idris.Output (iputStrLn, iRenderOutput, iPrintResult, iRenderError, iRenderResult, prettyDocumentedIst)
34import Idris.IBC
34import Idris.IBC
36import Prelude hiding (pred)
36import Prelude hiding (pred)
@@ -54,10 +54,12 @@ searchByType pkgs pterm = do
54 [ let docInfo = (n, delabTy i n, fmap (overview . fst) (lookupCtxtExact n (idris_docstrings i))) in
54 [ let docInfo = (n, delabTy i n, fmap (overview . fst) (lookupCtxtExact n (idris_docstrings i))) in
55 displayScore theScore <> char ' ' <> prettyDocumentedIst i docInfo
55 displayScore theScore <> char ' ' <> prettyDocumentedIst i docInfo
56 | (n, theScore) <- names']
56 | (n, theScore) <- names']
57− case idris_outputmode i of
58+ then case idris_outputmode i of
58− RawOutput _ -> do mapM_ iRenderOutput docs
59+ RawOutput _ -> do mapM_ iRenderOutput docs
59− iPrintResult ""
60+ iPrintResult ""
60− IdeMode _ _ -> iRenderResult (vsep docs)
61+ IdeMode _ _ -> iRenderResult (vsep docs)
62+ else iRenderError $ text "No results found"
61 putIState i -- don't actually make any changes
63 putIState i -- don't actually make any changes
63 numLimit = 50
65 numLimit = 50