on master help sign in
Show types in IDE namespace browser
6d42600David Raymond Christiansen
src/Idris/REPL.hs+16−5
@@ -490,12 +490,23 @@ runIdeModeCommand h id orig fn modes (IdeMode.BrowseNS ns) =
490 if null underNSs && null names
490 if null underNSs && null names
491 then iPrintError "Invalid or empty namespace"
491 then iPrintError "Invalid or empty namespace"
492 else do ist <- getIState
492 else do ist <- getIState
493+ underNs <- mapM pn names
493− let msg = (IdeMode.SymbolAtom "ok", (underNSs, map (pn ist) names))
494+ let msg = (IdeMode.SymbolAtom "ok", (underNSs, underNs))
494 runIO . hPutStrLn h $ IdeMode.convSExp "return" msg id
495 runIO . hPutStrLn h $ IdeMode.convSExp "return" msg id
496+ where pn n =
497+ do ctxt <- getContext
498+ ist <- getIState
499+ return $
495− where pn ist = displaySpans .
500+ displaySpans .
496− renderPretty 0.9 1000 .
501+ renderPretty 0.9 1000 .
497− fmap (fancifyAnnots ist True) .
502+ fmap (fancifyAnnots ist True) $
498− prettyName True True []
503+ prettyName True False [] n <>
504+ case lookupTyExact n ctxt of
505+ Just t ->
506+ space <> colon <> space <> align (group (pprintDelab ist t))
507+ Nothing ->
508+ empty
509+
499runIdeModeCommand h id orig fn modes (IdeMode.TermNormalise bnd tm) =
510runIdeModeCommand h id orig fn modes (IdeMode.TermNormalise bnd tm) =
500 do ctxt <- getContext
511 do ctxt <- getContext
501 ist <- getIState
512 ist <- getIState