Can the LSP library be used in other LSPs?
When looking for an LSP library for my own LSP, I came across this post which recommended using the LSP library from ocaml-lsp. I was able to import it into my project, though I'm not exactly sure where to start. It would be very helpful if there was an example of a simple, minimal LSP that uses this library. In fact, perhaps I can fork this library and turn it into a dedicated LSP library, rather than it just being a part of the ocaml-lsp. What do you guys think? I'll start by figuring out how to get a simple LSP up and running. Once that's done, I'll try to communicate what I learned in a basic GETTING_STARTED.md for using the library. Any help is greatly appreciated!
Yes, the LSP library should be a good starting point to build other LSPs and it is already packaged separately: https://ocaml.org/p/lsp/latest
It provides a description of the protocol with Yojson encoders and decoders. I am not familiar with it but would expect one need to instantiate the Io.Make functor to make the best use of it (for the ocaml-lsp-server this is done in lsp-fiber but you probably want to use a more mainstream scheduler like lwt, async, eio, etc.). Maybe @ulugbekna knows more ? There might be other projects using it in the wilds too :-)
I think we would be perfectly happy to review and add simpler usage examples for people who want to build on it. Another option would be a repository that shows how to use the Lsp library to build a simple(r) server. Unless you have heavy changes to do to the library (for which our review would slow down your development) I don't really see a reason for forking or extracting the library.
I don't see a need for any heavy changes to do for the library. As far as I can tell, there are no other projects that use this library, so it that definitely exasperates the need for a simple example. I'll see what I can do to get one up and running!