diff --git a/src/Lean/Language/Lean.lean b/src/Lean/Language/Lean.lean index c5aa9a4992f4..37a6cf42e2cf 100644 --- a/src/Lean/Language/Lean.lean +++ b/src/Lean/Language/Lean.lean @@ -385,20 +385,19 @@ where tacticCache ctx - let next? โ† if Parser.isTerminalCommand stx then pure none + if Parser.isTerminalCommand stx then + prom.resolve <| .mk (nextCmdSnap? := none) <| Runtime.markPersistent { + diagnostics := (โ† Snapshot.Diagnostics.ofMessageLog msgLog) + stx + parserState + elabSnap := { range? := stx.getRange?, task := elabPromise.result } + finishedSnap + tacticCache + } -- for now, wait on "command finished" snapshot before parsing next command - else some <$> IO.Promise.new - prom.resolve <| .mk (nextCmdSnap? := next?.map ({ range? := none, task := ยท.result })) <| Runtime.markPersistent { - diagnostics := (โ† Snapshot.Diagnostics.ofMessageLog msgLog) - stx - parserState - elabSnap := { range? := stx.getRange?, task := elabPromise.result } - finishedSnap - tacticCache - } - if let some next := next? then + else finishedSnap.get |> fun finished => - parseCmd none parserState finished.cmdState next ctx + parseCmd none parserState finished.cmdState prom ctx doElab (stx : Syntax) (cmdState : Command.State) (beginPos : String.Pos) (snap : SnapshotBundle DynamicSnapshot) (tacticCache : IO.Ref Tactic.Cache) :