Skip to content

Commit

Permalink
feat: add error if document is parsing
Browse files Browse the repository at this point in the history
If the document is parsing, the document should resend the
documentProofs request later.
  • Loading branch information
rtetley committed Dec 10, 2024
1 parent 8ba72e9 commit 18472f0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions language-server/vscoqtop/lspManager.ml
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,12 @@ let sendDocumentProofs id params =
let uri = textDocument.uri in
match Hashtbl.find_opt states (DocumentUri.to_path uri) with
| None -> log @@ "[documentProofs] ignoring event on non existent document"; Error({message="Document does not exist"; code=None}), []
| Some { st } -> let proofs = Dm.DocumentManager.get_document_proofs st in
Ok Request.Client.DocumentProofsResult.{ proofs }, []
| Some { st } ->
if Dm.DocumentManager.is_parsing st then
Error {code=(Some Jsonrpc.Response.Error.Code.ServerCancelled); message="Parsing not finished"} , []
else
let proofs = Dm.DocumentManager.get_document_proofs st in
Ok Request.Client.DocumentProofsResult.{ proofs }, []

let workspaceDidChangeConfiguration params =
let Lsp.Types.DidChangeConfigurationParams.{ settings } = params in
Expand Down

0 comments on commit 18472f0

Please sign in to comment.