Commit c1395da6 authored by Vaibhav Sagar's avatar Vaibhav Sagar

Implement working :sprint

parent bea11742
...@@ -786,16 +786,16 @@ evalCommand _ (Directive GetDoc query) state = safely state $ do ...@@ -786,16 +786,16 @@ evalCommand _ (Directive GetDoc query) state = safely state $ do
results <- liftIO $ Hoogle.document query results <- liftIO $ Hoogle.document query
return $ hoogleResults state results return $ hoogleResults state results
evalCommand _ (Directive SPrint binding) state = safely state $ do evalCommand _ (Directive SPrint binding) state = wrapExecution state $ do
flags <- getSessionDynFlags
contents <- liftIO $ newIORef []
let action = \_dflags _sev _srcspan _ppr _style msg -> modifyIORef' contents (showSDoc flags msg :)
let flags' = flags { log_action = action }
_ <- setSessionDynFlags flags'
Debugger.pprintClosureCommand False False binding Debugger.pprintClosureCommand False False binding
return _ <- setSessionDynFlags flags
EvalOut sprint <- liftIO $ readIORef contents
{ evalStatus = Success return $ formatType (unlines sprint)
, evalResult = mempty
, evalState = state
, evalPager = []
, evalMsgs = []
}
evalCommand output (Statement stmt) state = wrapExecution state $ evalStatementOrIO output state evalCommand output (Statement stmt) state = wrapExecution state $ evalStatementOrIO output state
(CapturedStmt stmt) (CapturedStmt stmt)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment