coq-serapi icon indicating copy to clipboard operation
coq-serapi copied to clipboard

Language Server Protocol

Open ejgallego opened this issue 9 years ago • 13 comments

We should support LSP to some degree.

https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md

ejgallego avatar Oct 26 '16 12:10 ejgallego

An OCaml implementation of LSP data structures is here: https://github.com/facebook/hhvm/blob/master/hphp/hack/src/utils/lsp.ml

Would we get then a TODO list, it should be easy to support this in a basic sense. Some more advances capabilites of the LSP are quite hard to do due to Coq internals.

ejgallego avatar Mar 05 '18 00:03 ejgallego

This is well on the road and working now; it wouldn't be unreasonable to expect SerAPI to build on the LSP kernel for 0.7.0

ejgallego avatar Feb 14 '19 00:02 ejgallego

I'd like to help with this issue, do you know of some relatively self-contained work that needs to get done to support LSP?

carlpaten-ivadolabs avatar Mar 15 '19 22:03 carlpaten-ivadolabs

@lilred as I mentioned in the other issue, there is an in-progress branch. If you can I can give you access, but we'd still like to rewrite the whole server implementation before releasing to better account for the nuances of inter-process communication.

ejgallego avatar Mar 16 '19 18:03 ejgallego

@ejgallego any chance I can get access to the in-progress branch?

carlpaten-ivadolabs avatar Sep 22 '19 21:09 carlpaten-ivadolabs

@lilred I could give you access to the tree however that wouldn't help a lot; the main issue here and where work is concentrated now is in the base Coq API for incremental document checking.

Until that is ready, proper LSP is too hard to implement reliably IMO. So first we are working on icheck, then coq-lsp will be built on top of that [and serapi too].

I hope a first "alpha" version of icheck is ready soon, so indeed at that point we could try to make the lsp code work; what are your goals? I'd be great indeed to setup the minimal amount of code so collaboration is possible.

As for now, the Coq branch of the LSP server is basically this code but adapted to Coq without significant changes.

ejgallego avatar Oct 07 '19 08:10 ejgallego

what are your goals?

Broadly, to invest in something Coq-related for ~150 hours with between February and April. Also, I'd like to do my part towards moving on from CoqIDE to something more flexible and modern. Not that CoqIDE is particularly bad, in fact it's surprisingly good, but it's not easily extensible and I haven't figured out how to "look under the hood" and work around its warts.

the main issue here and where work is concentrated now is in the base Coq API for incremental document checking

Can you point me to that work? Or is it not publicly accessible?

Best

carlpaten-ivadolabs avatar Oct 09 '19 12:10 carlpaten-ivadolabs

Hi @lilred , indeed I think your timeframe should work pretty well.

Can you point me to that work? Or is it not publicly accessible?

Sure, I will give you some pointers in the next weeks; the reason the current prototype is not publicily accessible is that it is still not usable and I feel it would make many people lose a lot of time.

Indeed, the current prototype needs a full rewrite once we improve the Coq API itself, but that should happen pretty soon as we have made quite a bit of progress on the Coq side; the Coq PR allowing for the icheck / LSP prototype to function should land in master soon.

ejgallego avatar Oct 14 '19 22:10 ejgallego

the Coq PR allowing for the icheck / LSP prototype to function should land in master soon.

What PR would that be? :)

carlpaten-ivadolabs avatar Oct 15 '19 13:10 carlpaten-ivadolabs

@lilred for example https://github.com/coq/coq/pull/10681 and https://github.com/coq/coq/pull/10884 and a couple other more that have not been submitted yet.

See also https://github.com/coq/coq/issues/10041

ejgallego avatar Oct 15 '19 15:10 ejgallego

Also, I'd like to do my part towards moving on from CoqIDE to something more flexible and modern. Not that CoqIDE is particularly bad, in fact it's surprisingly good, but it's not easily extensible and I haven't figured out how to "look under the hood" and work around its warts.

Note that VsCoq (https://github.com/coq-community/vscoq) is pursuing very similar goals.

maximedenes avatar Oct 16 '19 16:10 maximedenes

@lilred for example coq/coq#10681 and coq/coq#10884 and a couple other more that have not been submitted yet.

Welp, that's indeed on the Coq side, and rather deeper stuff than I can chew as of right now. If that's where the action is I'm going to start digging into Coq internals as soon as I have time. If you know of any particularly useful introductory material or well-defined low-hanging fruit that a newcomer could likely deal with, let me know.

carlpaten-ivadolabs avatar Oct 19 '19 23:10 carlpaten-ivadolabs

Thanks @lilred , I'm unsure if there is any resource that would help right now; hopefully the situation does improve before Christmas.

ejgallego avatar Oct 20 '19 21:10 ejgallego