This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-05
Channels
- # announcements (19)
- # babashka (28)
- # beginners (62)
- # biff (3)
- # calva (19)
- # cider (24)
- # clj-kondo (8)
- # cljdoc (15)
- # clojure (32)
- # clojure-europe (16)
- # clojure-nl (1)
- # clojure-norway (17)
- # clojure-uk (8)
- # clojuredesign-podcast (26)
- # cursive (64)
- # datomic (43)
- # deps-new (1)
- # fulcro (4)
- # honeysql (1)
- # hyperfiddle (46)
- # kaocha (16)
- # lsp (15)
- # missionary (51)
- # music (1)
- # nbb (4)
- # off-topic (55)
- # pedestal (11)
- # podcasts-discuss (1)
- # polylith (7)
- # practicalli (1)
- # releases (4)
- # shadow-cljs (120)
- # tools-build (34)
- # vscode (1)
- # xtdb (2)
After completing a clean installation of Visual Studio Code, the Calva extension, and Clojure-lsp, I consistently encounter server connection issues when opening a Clojure workspace. The error messages are as follows:
[Error - 9:34:36 AM] Connection to server got closed. Server will not be restarted.
[Error - 9:34:36 AM] Server initialization failed.
◦ Message: Pending response rejected since connection got disposed
◦ Error Code: -32097
I'm looking for guidance on identifying potential causes for these issues. Are there any known conflicts or bugs that could be responsible for this behavior? Any additional components that I should consider checking or updating?
Using clojure-lsp.exe
directly like in the explanation here:
https://clojure-lsp.io/troubleshooting/#server-is-not-initializing
works just fine
My colleagues are not facing this issue, although we have pretty much identical setups. We have also compared java versions now
Sounds a bit like you are running into this issue: https://github.com/BetterThanTomorrow/calva/issues/2251
Which clojure-lsp.exe is it that works using directly? You could try telling Calva to use that one and see if that works. There’s a setting calva.clojureLspPath
for this. It’s set to latest
by default, but if you set an absolute path to a binary, Calva will use that instead (after a restart of clojure-lsp, which you can do via a command or via the status bar button).
Before the issues with clojure-lsp, I realize that I get one more error:
Internal error
Source: Calva: Clojure & ClojureScript Interactive Programming (Extension)
Is it possible to make these errors more verbose?Could be. I have no idea where this particular one comes from, though. Internal error… could be clojure-lsp… Could also be that we write the more extensive info to the console at that point.
Hi guys. Recently I noticed something: clojure-lsp is using the swap memory a lot. I’m not really sure is it on my machine only, or it’s by design. First photo - my free ram memory and the swp. Then I run
sudo fs_usage | grep swapfile
and mainly the clojure-lsp is the one that is writing. When I opened the activity monitor I have like …. 10 clojure-lsp processes that run and takes a lot of memory. Is there a way for optimization? btw I have a lot of vscode instanaces running (we have a lot of projects) but not actively develop code with them, they are opened just for reference or investigation
Hi! Calva will start a clojure-lsp process for each VS Code window with a Clojure project in it. You can tell Calva to not do this automatically, and then start it manually (there’s a status bar button that makes this easy).
Thanks @U0ETXRFEW I saw that one, but I was wondering is there another way around, cause the LSP is really good and useful. It will be a shame to not use it 😄 I saw in couple of places that there’s “alternative” of that, the guys were mentioning “repl tooling”. Do you know what they are talking about and where I can read more about it?
btw if someone happens to be interested in that topic, here’s a ticket for that feature which is still open https://github.com/clojure-lsp/clojure-lsp/issues/280
Calva will fall back to repl tooling if clojur-lsp is not present. Some things won’t work, but when you miss clojure-lsp, you can always start it.
@U0ETXRFEW last one - is there a way to optimise the consumption of the memory with graalvm for example? btw here is a thread about a setup for that issue. Sorry that I asked before actually finish my search https://clojurians.slack.com/archives/CBE668G4R/p1674579601969449?thread_ts=1674566844.014189&cid=CBE668G4R
If the question is if I know how to tweak clojure-lsp memory consumption, then I don’t. But arranging the projects so that one clojure-lsp can server them all will have you start many fewer. And it will also create a better repl experience, if you also start the repl on that top level.
@U03SN3M2W0Y, there is a perf improv I'm about to make in clojure-lsp related to Graal but should improve mostly CPU, about memory, that's one of the hardest things to improve, one way is to disable some features like java analysis, adding :java nil
to your .lsp/config.edn may help
Thank you guys 🙂
Can we disable clojure-lsp and calva formatting options for files that have merge conflicts? I found LSP is blocking gitlens tools “accept current change | …” thingy from appearing and copy paste performs unexpected formatting breaking conflicts structure.