@@ -30,7 +30,7 @@ import Idris.Core.Unify (match_unify)
3030import Idris.Delaborate (delabTy)
3131import Idris.Docstrings (noDocs, overview)
3232import Idris.Elab.Type (elabType)
33−import Idris.Output (iputStrLn, iRenderOutput, iPrintResult, iRenderResult, prettyDocumentedIst)
33+import Idris.Output (iputStrLn, iRenderOutput, iPrintResult, iRenderError, iRenderResult, prettyDocumentedIst)
3434import Idris.IBC
3535
3636import Prelude hiding (pred)
@@ -54,10 +54,12 @@ searchByType pkgs pterm = do
5454 [ let docInfo = (n, delabTy i n, fmap (overview . fst) (lookupCtxtExact n (idris_docstrings i))) in
5555 displayScore theScore <> char ' ' <> prettyDocumentedIst i docInfo
5656 | (n, theScore) <- names']
57− case idris_outputmode i of
58− RawOutput _ -> do mapM_ iRenderOutput docs
59− iPrintResult ""
60− IdeMode _ _ -> iRenderResult (vsep docs)
57+ if (not (null docs))
58+ then case idris_outputmode i of
59+ RawOutput _ -> do mapM_ iRenderOutput docs
60+ iPrintResult ""
61+ IdeMode _ _ -> iRenderResult (vsep docs)
62+ else iRenderError $ text "No results found"
6163 putIState i -- don't actually make any changes
6264 where
6365 numLimit = 50