I have a project in which I need to write an LSP server in OCaml for a developing language. So I did a lot of research on this but I'm having a bit of a hard time getting through it.
The Microsoft tutorial https://microsoft.github.io/language-server-protocol/specification speaks sometimes on the server side, sometimes on the client side, sometimes JSON RPC through which requests and notifications must pass between the client and the server, and all of that mixed up, plus TypeScript and not OCaml, what I want to use as a language confuses me a bit, I feel like I don't understand anything.
So I turned to code. I saw a lot of code like the one from https://github.com/facebook/flow/tree/master/src/lsp, the one from https://github.com/ocaml/ocaml-lsp but I don't understand really the code, there are a lot of files with a lot of lines, I don't know what does what. Can you show me an example of how to initiate connection with the first initiate request, send notification in OCaml. I will use Emacs as client but I know how to do that when the server is ready. I think a little example will help me do the rest.