I always think of how I have to reinstall ocaml-lsp-server every single time I setup a new project. I’ve been thinking of how could this be easier? Couldn’t we have a way of having a global installation of ocaml-lsp-server and use that by default? Or could we make it automated so everything I’d setup a new switch it’d get automatically installed?
Aren’t there any ways of solving the currently?
There is the ocaml-platform-installer tool, which installs a set platform tools and cache them in an opam repository (containing only the binaries, not the libraries). So when you create a new switch, running
ocaml-platform will pick up the cached
ocaml-lsp-server if it exists. More explanations on the repo!
ocaml-lsp-server is installed globally in DkML (Windows) and works without having to be installed in a switch. Don’t think there is any magic needed for ocaml-lsp-server in particular; just stick it in your PATH.
If you are adventurous, the next version of DkML (already released but unannounced) has an alpha for macOS/Silicon and modern GNU/Linux distros.
That’s a great solution, it partially solves my problem because I keep forgetting to install it on the switch and it takes extra time to download it. But caching seems to be a very good option.
I didn’t know about DkML, may give it a try at some point. I really think OCaml should have good Windows support.
I`ll try have the LSP server installed globally.