feat: make withWaitFindSnap consider all snaps of a document
This commit is contained in:
parent
e584560b17
commit
ecaa004dcc
2 changed files with 8 additions and 1 deletions
|
|
@ -58,6 +58,13 @@ structure EditableDocument where
|
|||
cancelTk : CancelToken
|
||||
deriving Inhabited
|
||||
|
||||
namespace EditableDocument
|
||||
|
||||
def allSnaps (doc : EditableDocument) : AsyncList ElabTaskError Snapshot :=
|
||||
AsyncList.cons doc.headerSnap doc.cmdSnaps
|
||||
|
||||
end EditableDocument
|
||||
|
||||
structure RpcSession where
|
||||
/-- Objects that are being kept alive for the RPC client, together with their type names,
|
||||
mapped to by their RPC reference.
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ def withWaitFindSnap (doc : EditableDocument) (p : Snapshot → Bool)
|
|||
(notFoundX : RequestM β)
|
||||
(x : Snapshot → RequestM β)
|
||||
: RequestM (RequestTask β) := do
|
||||
let findTask ← doc.cmdSnaps.waitFind? p
|
||||
let findTask ← doc.allSnaps.waitFind? p
|
||||
mapTask findTask fun
|
||||
/- The elaboration task that we're waiting for may be aborted if the file contents change.
|
||||
In that case, we reply with the `fileChanged` error. Thanks to this, the server doesn't
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue