Bringing Emacs Support to OCaml's LSP Server with ocaml-eglot
12 points by xvw
12 points by xvw
Why is the lsp not compatible out of the box with lsp-mode and eglot?
Hi! I was hoping that the article would be clear enough, but yes, eglot and lsp-mode work out of the box for the functions designed by LSP. OCaml-eglot provides, through Eglot in particular, additional features not covered by the LSP protocol.
LSP aims to be compatible with as many languages as possible, making some assumptions about how those languages are structured and function. Inevitably, these assumptions cannot cover all the features of every language. This is true of OCaml, where the editing experience relies on custom features outside the scope of the LSP.
So you have a high-level mention of the fact that the built-in LSP operations are insufficient, but then further down under the "Features" section, all those listed features are things that eglot supports out of the box in most languages without any additional client smarts. On top of that, eglot already supports arbitrary server-provided code actions, so why was the existing support there considered insufficient?
Given that the entire point of LSP is to standardize things in such a way that they don't require custom client code, the existence of ocaml-eglot could be interpreted as a failure of the standard to achieve its goals. I'd definitely be interested in a more detailed examination of "Here's how LSP tried to accomplish this, but they did not foresee challenges X, Y, and Z which could not fit into the language-agnostic model they defined, so we were forced to step outside the existing spec."
Even more interesting would be "...and here's how we would suggest the specification be improved so that all editors could benefit from these features and extensions like ocaml-eglot would be unnecessary in the future!"
Given that the entire point of LSP is to standardize things in such a way that they don't require custom client code
It does that, but there are also features it doesn't cover that LSP's may provide and that don't make sense for every language ej. macro-expasion (in rust). eglot collaborator, nemethf has maintained eglot-x for assorted extensions
This is a great project announcement. It covers everything I need to know: who it's for, why it exists, how it's different from competitors, etc. Nice!