-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get proof blocks api #960
Get proof blocks api #960
Changes from 6 commits
4f1a647
242788d
d2e9efc
0b05cfb
bcedd85
5727911
16ae8d0
a3b30ba
8ba72e9
18472f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -248,6 +248,22 @@ module Request = struct | |
|
||
end | ||
|
||
module DocumentProofsParams = struct | ||
|
||
type t = { | ||
textDocument: VersionedTextDocumentIdentifier.t | ||
} [@@deriving yojson] | ||
|
||
end | ||
|
||
module DocumentProofsResult = struct | ||
|
||
type t = { | ||
proofs: ProofState.proof_block list; | ||
} [@@deriving yojson] | ||
|
||
end | ||
|
||
type 'a t = | ||
| Std : 'a Lsp.Client_request.t -> 'a t | ||
| Reset : ResetParams.t -> unit t | ||
|
@@ -257,6 +273,7 @@ module Request = struct | |
| Print : PrintParams.t -> pp t | ||
| Search : SearchParams.t -> unit t | ||
| DocumentState : DocumentStateParams.t -> DocumentStateResult.t t | ||
| DocumentProofs : DocumentProofsParams.t -> DocumentProofsResult.t t | ||
|
||
type packed = Pack : 'a t -> packed | ||
|
||
|
@@ -284,6 +301,9 @@ module Request = struct | |
| "vscoq/documentState" -> | ||
let+ params = Lsp.Import.Json.message_params params DocumentStateParams.t_of_yojson in | ||
Pack (DocumentState params) | ||
| "vscoq/documentProofs" -> | ||
let+ params = Lsp.Import.Json.message_params params DocumentProofsParams.t_of_yojson in | ||
Pack (DocumentProofs params) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering if we can easily version these custom queries, eg There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So after thinking about it, we make it accessible through a function in the client. If we need new versions it should be easy to keep everything wired on our end when plugins use our extension. |
||
| _ -> | ||
let+ E req = Lsp.Client_request.of_jsonrpc req in | ||
Pack (Std req) | ||
|
@@ -298,6 +318,7 @@ module Request = struct | |
| Print _ -> yojson_of_pp resp | ||
| Search _ -> yojson_of_unit resp | ||
| DocumentState _ -> DocumentStateResult.(yojson_of_t resp) | ||
| DocumentProofs _ -> DocumentProofsResult.(yojson_of_t resp) | ||
| Std req -> Lsp.Client_request.yojson_of_result req resp | ||
|
||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This promise should probably be returned