I managed to set up Emacs + TRAMP + LSP to do remote development (not on the first attempt though, as these things were quite fiddly to set up).
Here’s what I got:
- You need
opam install ocaml-lsp-serveron the remote machine. - Tell TRAMP to use path from the remote shell:
(add-to-list 'tramp-remote-path 'tramp-own-remote-path) - Use Eglot as an LSP client. Although,
lsp-modeclaims that they support remote servers, I couldn’t quite make it work withlsp-mode. This is what I have in myinit.el:
(require 'eglot)
(add-hook 'tuareg-mode-hook #'eglot-ensure)