-
Notifications
You must be signed in to change notification settings - Fork 72
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
Conversation
This will allow to create an api so that outside extensions can query the document and get a structured view of the proofs it contains.
Now extensions that depend on vscoq can get all the document proofs.
431d806
to
0b05cfb
Compare
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we can easily version these custom queries, eg "vscoq/documentProofs/v1"
so that we can update the format later without necessarily breaking badly the plugins that use this extension
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.
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.
client/src/extension.ts
Outdated
const params: DocumentProofsRequest = {textDocument}; | ||
const req = new RequestType<DocumentProofsRequest, DocumentProofsResponse, void>("vscoq/documentProofs"); | ||
Client.writeToVscoq2Channel("Getting proofs for: " + uri.toString()); | ||
client.sendRequest(req, params).then( |
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
8a582b4
to
a3b30ba
Compare
Before we would only add new sentences during the parsing phase, which works on the first parsing but leads to unwanted behaviors after an edit.
If the document is parsing, the document should resend the documentProofs request later.
This PR aims at exposing an API which will allow extensions to query the document and get proof blocks in a structured view. This can be useful for a number of users who which to build an extension to vscoq.
Down the line we also ended up fixing an outline bug, in which symbols were never removed but always added.