Language Server Protocol proposal#15736
Closed
artagnon wants to merge 1 commit intorocq-prover:masterfrom
artagnon:lsp
Closed
Language Server Protocol proposal#15736artagnon wants to merge 1 commit intorocq-prover:masterfrom artagnon:lsp
artagnon wants to merge 1 commit intorocq-prover:masterfrom
artagnon:lsp
Conversation
Contributor
|
@artagnon we already have at least two fucntioning lsp servers for Coq, and they are way more advanced than this. I'd suggest coordination with us over Zulip, I can give you access to my own private repos and I'd love to discuss more. I tell you something, this is not trivial at all to get right. Moreover, there is no need to have this server, in such experimental state, in the codebase, it can live perfectly as a separate project for the moment. |
Contributor
Author
|
Some things to address:
I have no particular stake in this: it was 1.5 days of work, and I put it up because I needed help at this point. |
Contributor
|
@artagnon see my message on zulip
|
Contributor
Author
|
Okay, I'm dropping this in favor of @ejgallego's coq-lsp, which I will see in person next week. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Language Server Protocol is a widely-used communication protocol, with first-class support in VSCode, and decent support in Vim and Emacs. Very many servers and client implementations exist today, for a wide variety of languages. However, a cursory look at the document is enough to know that the protocol has not standarized any functionalities that are relevant to interactive proof assistants, and in particular, Coq. However, it is easy to deviate from the standard described in the document, and implement custom extensions. The particular ease-of-implementation of a server and client makes LSP a particularly attractive choice.
Today, we have VSCoq communicating via an XML-protocol, and the server implementation is in coqidetop. However, VSCoq suffers from the problem of being difficult to understand and maintain, let alone extend, due to its sheer size. Besides, the XML protocol is poorly documented, and CoqIDE is the first-class consumer. While it is possible to enhance the XML protocol to support some additional functionality, to expose more of the information available in
Vernac.State.t, and enhance the overall experience of writing Coq, adding complexity to an already complex VSCoq would probably be unwise.It would indeed be most pleasant if we manage to manage to augment LSP to support interactive proof assistants in an agnostic way. It would benefit all proof assistants across the board, and eliminate the burden of having to develop and maintain a separate IDE. It would reduce the burden on Proof General too, as they can use the Emacs LSP extension and get most of the low-level functionality for free. Indeed, it would reduce the burden on us too, if we consider phasing out CoqIDE and moving to this proposed setup, in the long term. While I've opened microsoft/language-server-protocol#1414, much of its success depends on presenting a working implementation.
On the subject of this particular patch, I'm proposing to create a
ide/lsp, where we can carry out these experiments. I'm feeling mildly optimistic about its success. Of course, there's always the risk that it won't gain traction, in which case, tant pis. The effort brings a lot of potential benefits for everyone, and it's not too hard.I'm stuck at the moment with a compiler error in
lsptop.mlwhich I haven't been to resolve. I don't know if streams are a good solution, and I'm not an OCaml expert to convert from byte streams written into some buffer into a string stream. Otherwise, the rest of the code should be pretty straightforward.