|
|
|
@ -386,8 +386,8 @@ def publishProofState (m : DocumentMeta) (snap : Snapshot) (initParams : Lsp.Ini
|
|
|
|
|
|
|
|
|
|
|
|
hOut.writeLspNotification { method := "$/game/publishProofState", param }
|
|
|
|
hOut.writeLspNotification { method := "$/game/publishProofState", param }
|
|
|
|
|
|
|
|
|
|
|
|
/-- Checks whether game level has been completed and sends a notification to the client -/
|
|
|
|
/-- Checks whether game level has been completed and sends a notification to the client -/
|
|
|
|
def publishGameCompleted (m : DocumentMeta) (hOut : FS.Stream) (snaps : Array Snapshot) : IO Unit := do
|
|
|
|
def publishGameCompleted (m : DocumentMeta) (hOut : FS.Stream) (snaps : Array Snapshot) : IO Unit := do
|
|
|
|
-- check if there is any error or warning
|
|
|
|
-- check if there is any error or warning
|
|
|
|
for snap in snaps do
|
|
|
|
for snap in snaps do
|
|
|
|
if snap.diagnostics.any fun d => d.severity? == some .error ∨ d.severity? == some .warning
|
|
|
|
if snap.diagnostics.any fun d => d.severity? == some .error ∨ d.severity? == some .warning
|
|
|
|
@ -395,9 +395,9 @@ def publishProofState (m : DocumentMeta) (snap : Snapshot) (initParams : Lsp.Ini
|
|
|
|
let param := { uri := m.uri : GameCompletedParams}
|
|
|
|
let param := { uri := m.uri : GameCompletedParams}
|
|
|
|
hOut.writeLspNotification { method := "$/game/completed", param }
|
|
|
|
hOut.writeLspNotification { method := "$/game/completed", param }
|
|
|
|
|
|
|
|
|
|
|
|
/-- copied from `Lean.Server.FileWorker.nextCmdSnap`. -/
|
|
|
|
/-- copied from `Lean.Server.FileWorker.nextCmdSnap`. -/
|
|
|
|
-- @[inherit_doc Lean.Server.FileWorker.nextCmdSnap] -- cannot inherit from private
|
|
|
|
-- @[inherit_doc Lean.Server.FileWorker.nextCmdSnap] -- cannot inherit from private
|
|
|
|
private def nextCmdSnap (ctx : WorkerContext) (m : DocumentMeta) (cancelTk : CancelToken)
|
|
|
|
private def nextCmdSnap (ctx : WorkerContext) (m : DocumentMeta) (cancelTk : CancelToken)
|
|
|
|
(gameWorkerState : WorkerState) (initParams : Lsp.InitializeParams) :
|
|
|
|
(gameWorkerState : WorkerState) (initParams : Lsp.InitializeParams) :
|
|
|
|
AsyncElabM (Option Snapshot) := do
|
|
|
|
AsyncElabM (Option Snapshot) := do
|
|
|
|
cancelTk.check
|
|
|
|
cancelTk.check
|
|
|
|
@ -424,9 +424,9 @@ def publishProofState (m : DocumentMeta) (snap : Snapshot) (initParams : Lsp.Ini
|
|
|
|
publishIleanInfoUpdate m ctx.hOut #[snap]
|
|
|
|
publishIleanInfoUpdate m ctx.hOut #[snap]
|
|
|
|
return some snap
|
|
|
|
return some snap
|
|
|
|
|
|
|
|
|
|
|
|
-- Copied from `Lean.Server.FileWorker.unfoldCmdSnaps` using our own `nextCmdSnap`.
|
|
|
|
-- Copied from `Lean.Server.FileWorker.unfoldCmdSnaps` using our own `nextCmdSnap`.
|
|
|
|
@[inherit_doc Lean.Server.FileWorker.unfoldCmdSnaps]
|
|
|
|
@[inherit_doc Lean.Server.FileWorker.unfoldCmdSnaps]
|
|
|
|
def unfoldCmdSnaps (m : DocumentMeta) (snaps : Array Snapshot) (cancelTk : CancelToken)
|
|
|
|
def unfoldCmdSnaps (m : DocumentMeta) (snaps : Array Snapshot) (cancelTk : CancelToken)
|
|
|
|
(startAfterMs : UInt32) (gameWorkerState : WorkerState)
|
|
|
|
(startAfterMs : UInt32) (gameWorkerState : WorkerState)
|
|
|
|
: ReaderT WorkerContext IO (AsyncList ElabTaskError Snapshot) := do
|
|
|
|
: ReaderT WorkerContext IO (AsyncList ElabTaskError Snapshot) := do
|
|
|
|
let ctx ← read
|
|
|
|
let ctx ← read
|
|
|
|
|