This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Hi! Is it possible to connect remotely to clojure-lsp? Usecase is that I have a machine which doesn't support the graalvm, but I can run clojure-lsp on a different box / a vm
Which machine is this if I may ask? You can use clojure-lsp as jar file as well, you don't need to use the binary necessarily
see jar file here: https://github.com/clojure-lsp/clojure-lsp/releases/tag/2024.08.05-18.16.00
but @UKFSJSM38 knows
FWIW I always run clojure-lsp from source combined with clj-kondo from source (since I want to see my development changes locally).
How to do this, search on this page: https://github.com/clj-kondo/clj-kondo/blob/master/doc/editor-integration.md
for ~/bin/clojure-lsp-dev
standalone is the way to go, you will lose performance compared with the graal one but it should work
It seems to be working but I still run into one issue. To detail the setup, the source code resides in the VM too (because it uses docker for a bunch of stuff), I use sshfs to access it, + port forwarding to access the nrepl from the host, all this works fine. However, the lsp seems to be stuck on "analyzing external classpath"
Yeah, pretty much it won't work, the support for remote code in clojure-lsp is not good
Accessing the VM's nREPL from the host works fine if that's what you mean, and I think the lsp is treating this as local files (it first failed because it didn't get some dependencies and the error disappeared after a lein deps)
What I mean is you could check out the repo locally, but connect to the remote nREPL and evaluate your local files against the remote nREPL.
running java -jar clojure-lsp-standalon.jar --project-root ./ diagnostics
works fine and relatively fast
Another way could be to use a decent terminal editor like emacs or vim and run that remotely
ok, then you could run emacs remotely + the jar solution and edit remotely in an ssh or tmux session perhaps
but it seems like it's the diagnostics which runs out of memory when running from lsp-mode
but runs fine when running from a terminal