@@ -327,8 +327,9 @@ runIdeSlaveCommand id orig fn mods (IdeSlave.Metavariables cols) =
327 -> ([(String, String, SpanList OutputAnnotation)],
327 -> ([(String, String, SpanList OutputAnnotation)],
328 (String, SpanList OutputAnnotation))
328 (String, SpanList OutputAnnotation))
329 sexpGoal ist cols imp ns ([], concl) =
329 sexpGoal ist cols imp ns ([], concl) =
330+ let infixes = idris_infixes ist
330− let concl' = displaySpans . renderPretty 0.9 cols . fmap (fancifyAnnots ist) $
331+ concl' = displaySpans . renderPretty 0.9 cols . fmap (fancifyAnnots ist) $
331− pprintPTerm imp (zip ns (repeat False)) [] concl
332+ pprintPTerm imp (zip ns (repeat False)) [] infixes concl
332 in ([], concl')
333 in ([], concl')
333 sexpGoal ist cols imp ns ((n, t):ps, concl) =
334 sexpGoal ist cols imp ns ((n, t):ps, concl) =
334 let n' = case n of
335 let n' = case n of
@@ -337,7 +338,7 @@ runIdeSlaveCommand id orig fn mods (IdeSlave.Metavariables cols) =
337 | otherwise -> str nm
338 | otherwise -> str nm
339 (t', spans) = displaySpans . renderPretty 0.9 cols . fmap (fancifyAnnots ist) $
340 (t', spans) = displaySpans . renderPretty 0.9 cols . fmap (fancifyAnnots ist) $
340− pprintPTerm imp (zip ns (repeat False)) [] t
341+ pprintPTerm imp (zip ns (repeat False)) [] (idris_infixes ist) t
341 rest = sexpGoal ist cols imp (n:ns) (ps, concl)
342 rest = sexpGoal ist cols imp (n:ns) (ps, concl)
342 in ((n', t', spans) : fst rest, snd rest)
343 in ((n', t', spans) : fst rest, snd rest)
343runIdeSlaveCommand id orig fn mods (IdeSlave.WhoCalls n) =
344runIdeSlaveCommand id orig fn mods (IdeSlave.WhoCalls n) =
@@ -562,21 +563,19 @@ process h fn (Eval t)
562 ist <- getIState
563 ist <- getIState
563 logLvl 3 $ "Raw: " ++ show (tm', ty')
564 logLvl 3 $ "Raw: " ++ show (tm', ty')
564 logLvl 10 $ "Debug: " ++ showEnvDbg [] tm'
565 logLvl 10 $ "Debug: " ++ showEnvDbg [] tm'
565− let imp = opt_showimp (idris_options ist)
566− tmDoc = prettyImp imp (delab ist tm')
566+ let tmDoc = prettyIst ist (delab ist tm')
567− tyDoc = prettyImp imp (delab ist ty')
567+ tyDoc = prettyIst ist (delab ist ty')
568 ihPrintTermWithType h tmDoc tyDoc
568 ihPrintTermWithType h tmDoc tyDoc
570process h fn (ExecVal t)
570process h fn (ExecVal t)
571 = do ctxt <- getContext
571 = do ctxt <- getContext
572 ist <- getIState
572 ist <- getIState
573− let imp = opt_showimp (idris_options ist)
574 (tm, ty) <- elabVal toplevel False t
573 (tm, ty) <- elabVal toplevel False t
575-- let tm' = normaliseAll ctxt [] tm
574-- let tm' = normaliseAll ctxt [] tm
576 let ty' = normaliseAll ctxt [] ty
575 let ty' = normaliseAll ctxt [] ty
577 res <- execute tm
576 res <- execute tm
578− let (resOut, tyOut) = (prettyImp imp (delab ist res),
577+ let (resOut, tyOut) = (prettyIst ist (delab ist res),
579− prettyImp imp (delab ist ty'))
578+ prettyIst ist (delab ist ty'))
580 ihPrintTermWithType h resOut tyOut
579 ihPrintTermWithType h resOut tyOut
582process h fn (Check (PRef _ n))
581process h fn (Check (PRef _ n))
@@ -611,7 +610,7 @@ process h fn (Check (PRef _ n))
611 annotate (AnnName n Nothing Nothing Nothing) (text $ show n) <+> colon <+>
610 annotate (AnnName n Nothing Nothing Nothing) (text $ show n) <+> colon <+>
612 align (tPretty bnd ist g)
611 align (tPretty bnd ist g)
614− tPretty bnd ist t = pprintPTerm (opt_showimp (idris_options ist)) bnd [] t
613+ tPretty bnd ist t = pprintPTerm (opt_showimp (idris_options ist)) bnd [] (idris_infixes ist) t
617process h fn (Check t)
616process h fn (Check t)
@@ -622,19 +621,18 @@ process h fn (Check t)
622 ty' = normaliseC ctxt [] ty
621 ty' = normaliseC ctxt [] ty
623 case tm of
622 case tm of
624 TType _ ->
623 TType _ ->
625− ihPrintTermWithType h (prettyImp imp PType) type1Doc
624+ ihPrintTermWithType h (prettyIst ist PType) type1Doc
626− _ -> ihPrintTermWithType h (prettyImp imp (delab ist tm))
625+ _ -> ihPrintTermWithType h (prettyIst ist (delab ist tm))
627− (prettyImp imp (delab ist ty))
626+ (prettyIst ist (delab ist ty))
629process h fn (DocStr n)
628process h fn (DocStr n)
630− = do i <- getIState
629+ = do ist <- getIState
631− let imp = opt_showimp (idris_options i)
632− case lookupCtxtName n (idris_docstrings i) of
630+ case lookupCtxtName n (idris_docstrings ist) of
633 [] -> iPrintError $ "No documentation for " ++ show n
631 [] -> iPrintError $ "No documentation for " ++ show n
634− ns -> do toShow <- mapM (showDoc imp) ns
632+ ns -> do toShow <- mapM (showDoc ist) ns
635 ihRenderResult h (vsep toShow)
633 ihRenderResult h (vsep toShow)
636− where showDoc imp (n, d) = do doc <- getDocs n
634+ where showDoc ist (n, d) = do doc <- getDocs n
637− return $ pprintDocs imp doc
635+ return $ pprintDocs ist doc
638process h fn Universes
636process h fn Universes
639 = do i <- getIState
637 = do i <- getIState
640 let cs = idris_constraints i
638 let cs = idris_constraints i
@@ -826,9 +824,11 @@ process h fn (DoProofSearch updatefile rec l n hints)
826 (tm, ty) <- elabVal toplevel False (PRef fc mn)
824 (tm, ty) <- elabVal toplevel False (PRef fc mn)
827 ctxt <- getContext
825 ctxt <- getContext
828 i <- getIState
826 i <- getIState
827+ return . flip displayS "" . renderPretty 1.0 80 $
828+ pprintPTerm False [] [] (idris_infixes i)
829− return $ show (stripNS
829+ (stripNS
830− (dropCtxt envlen
830+ (dropCtxt envlen
831− (delab i (specialise ctxt [] [(mn, 1)] tm)))))
831+ (delab i (specialise ctxt [] [(mn, 1)] tm)))))
832 (\e -> return ("?" ++ show n))
832 (\e -> return ("?" ++ show n))
833 if updatefile then
833 if updatefile then
834 do let fb = fn ++ "~"
834 do let fb = fn ++ "~"
@@ -1051,15 +1051,14 @@ process h fn (SetConsoleWidth w) = setWidth w
1052process h fn (Apropos a) =
1052process h fn (Apropos a) =
1053 do ist <- getIState
1053 do ist <- getIState
1054− let impl = opt_showimp (idris_options ist)
1055 let names = apropos ist (T.pack a)
1054 let names = apropos ist (T.pack a)
1056 let aproposInfo = [ (n,
1055 let aproposInfo = [ (n,
1057 delabTy ist n,
1056 delabTy ist n,
1058 fmap (overview . fst) (lookupCtxtExact n (idris_docstrings ist)))
1057 fmap (overview . fst) (lookupCtxtExact n (idris_docstrings ist)))
1059 | n <- sort names, isUN n ]
1058 | n <- sort names, isUN n ]
1060− ihRenderResult h $ vsep (map (renderApropos impl) aproposInfo)
1059+ ihRenderResult h $ vsep (map (renderApropos ist) aproposInfo)
1061− where renderApropos impl (name, ty, docs) =
1060+ where renderApropos ist (name, ty, docs) =
1062− prettyName True [] name <+> colon <+> align (prettyImp impl ty) <$>
1061+ prettyName True [] name <+> colon <+> align (prettyIst ist ty) <$>
1063 fromMaybe empty (fmap (\d -> renderDocstring d <> line) docs)
1062 fromMaybe empty (fmap (\d -> renderDocstring d <> line) docs)
1064 isUN (UN _) = True
1063 isUN (UN _) = True
1065 isUN (NS n _) = isUN n
1064 isUN (NS n _) = isUN n