parent
7c3101a51c
commit
cd5dbc66ce
3 changed files with 21 additions and 5 deletions
|
|
@ -103,11 +103,22 @@ def compileNextCmd (contents : String) (snap : Snapshot) : IO (Sum Snapshot Mess
|
|||
fileName := inputCtx.fileName
|
||||
fileMap := inputCtx.fileMap
|
||||
}
|
||||
EIO.toIO ioErrorFromEmpty $
|
||||
Elab.Command.catchExceptions
|
||||
(Elab.Command.elabCommand cmdStx)
|
||||
cmdCtx cmdStateRef
|
||||
let postCmdState ← cmdStateRef.get
|
||||
let (output, _) ← IO.FS.withIsolatedStreams do
|
||||
EIO.toIO ioErrorFromEmpty do
|
||||
Elab.Command.catchExceptions
|
||||
(Elab.Command.elabCommand cmdStx)
|
||||
cmdCtx cmdStateRef
|
||||
let mut postCmdState ← cmdStateRef.get
|
||||
if !output.isEmpty then
|
||||
postCmdState := {
|
||||
postCmdState with
|
||||
messages := postCmdState.messages.add {
|
||||
fileName := inputCtx.fileName
|
||||
severity := MessageSeverity.information
|
||||
pos := inputCtx.fileMap.toPosition snap.endPos
|
||||
data := output
|
||||
}
|
||||
}
|
||||
let postCmdSnap : Snapshot := {
|
||||
beginPos := cmdPos
|
||||
stx := cmdStx
|
||||
|
|
|
|||
5
tests/lean/interactive/stdOutput.lean
Normal file
5
tests/lean/interactive/stdOutput.lean
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import Lean
|
||||
|
||||
elab "foo" : command => IO.println "hi"
|
||||
#eval "ho"
|
||||
foo
|
||||
0
tests/lean/interactive/stdOutput.lean.expected.out
Normal file
0
tests/lean/interactive/stdOutput.lean.expected.out
Normal file
Loading…
Add table
Reference in a new issue