-
Notifications
You must be signed in to change notification settings - Fork 34
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
Integrate with coq-lsp? #7
Comments
See also: https://github.com/ejgallego/pycoq |
We now have https://github.com/ejgallego/coq-lsp which is designed for UI interaction. If you are interested ping Emilio @ejgallego he can explain further. (You can think of coq-lsp as a successor to serapi). |
Thanks, I’ll take a look. From a quick skim of the features and FAQ, it’s not clear to me how easy it would be to swap out the XML protocol for coq-lsp without also redoing a lot of the Vim-side interface. For example, the continuous incremental checking seems great, but fundamentally a pretty different user experience from the current sentence-at-a-time approach. I wonder if it would make more sense to write something from scratch or to build on an existing Vim LSP plugin. I’d be curious to hear more about how the jsCoq port went and how widespread the changes were. |
For neovim, lean.nvim would be a good starting point. It uses neovim's built-in LSP client to communicate with Lean language server. |
@whonore , thanks for the comments, I am not familiar with Coqtail's current internals, so I can't tell how much would the switch to lsp go. A few notes:
Regarding SerAPI, it is to all effects deprecated, as in general coq-lsp provides a superset of the functionality with a better interface. |
Thanks for the info. I'll need to look further into the details, but it seems like it would require some pretty significant changes to Coqtail, although mostly welcome simplifications. Basically, I think most of the backend dealing with XML, sentence parsing, tracking state IDs, etc. would be thrown out and replaced with LSP client code. A lot of the frontend (syntax highlighting, mappings for commands, goal/info panel display) could probably be kept. In addition to looking at lean.nvim, it would be worth considering leveraging something like coc.nvim or ALE for the LSP part. |
Indeed, the way we have implemented LSP means that all code dealing with the XML protocol goes away in favor of simple loop where the editors update the server, and query in a position-based setup. But as you note this is an often welcome simplification, and provides some nice features due to coq-lsp supporting incremental-aware error recovery, so for example you can edit inside proofs without any special client code. It also makes supporting things like Coq Markdown files (.mv) very easy for clients. If there is something in coq-lsp we could do to make Coqtail's work easier I'd be very happy to hear. |
In case anyone wants to quickly try coq-lsp in neovim, here's a very simple client implementation based on neovim's built-in lsp client. https://github.com/tomtomjhj/coq-lsp.nvim |
I created an extremely preliminary, very experimental |
That's amazing @whonore ! A point of interest for clients is how to communicate to The solution that LSP 3.18 may provide and would work for Coq is Pull Diagnostics + a The above is not yet implemented in coq-lsp (tho a prototype exists) as VS Code doesn't set the An alternative to this is to allow We could also support a |
Might be interesting to use https://github.com/ejgallego/coq-serapi instead of talking to coqtop directly.
The text was updated successfully, but these errors were encountered: