Fork me on GitHub
#lsp
<
2024-01-06
>
markbastian19:01:12

I'm trying to install the clojure-lsp-intellij plugin and am seeing the following error when I start my project. I've tried the following in an IntelliJ terminal to diagnose:

➜  git:(main) ✗ which clojure
/opt/homebrew/bin/clojure
➜  git:(main) ✗ which clojure-lsp
/opt/homebrew/bin/clojure-lsp
So, it looks like both clojure and clojure-lsp (even though this shouldn't matter since it sounds like the executable is bundled in the plugin) are on the path. I've also tried adding export PATH=$PATH:/opt/homebrew/bin to my .zprofile since I know IntelliJ has some issues with locating items on the shell path (items from .zshrc, but that didn't work. This seems related to https://github.com/clojure-lsp/clojure-lsp-intellij/issues/26(same underlying cause?). Anyone have any ideas as to how to get this working? Thanks!

borkdude19:01:09

Small note to whoever invokes the CLI: -S options go before -A. This isn’t the fix for your problem, just something that should be adhered to to prevent other problems

👍 1
markbastian19:01:33

➜  git:(main) ✗ clojure -A:test:dev -Spath
test:dev:src:resources:/Users/mbastian/.m2/repository/buddy/buddy-core/1.11.423/buddy-core-1.11.423.jar:/....lots more stuff
That also works. I'm still wondering if it has to do with how IJ computes the underlying path. FYI, I'm on a M3 with the latest Sonoma OS.

markbastian00:01:33

Well, I honestly have no idea whether the fix was to launch once from the command line and let the settings dialog populate from there or to set the PATH in a .zshenv file. I uninstalled the plugin to try to reproduce the failure mode, but when I reinstalled it everything still works. So, if anyone happens to have this issue, the solution is either to run from the command line once for a successful config or to add the brew path to .zshenv. I'm leaning towards the first one being the solution.

ericdallo02:01:19

@U0JUR9FPH thanks for the test, this is the most critical bug I would like to fix it, I tried multiple things to fix that out of the box without success, there is a whole complexity how that works for Intellij, but if you found way to fix it, please let's create a FAQ or troubleshooting section so we can explain that. The reason you cannot reproduce is because the analysis is cached after a successful run, if you rm -rf .lsp/.cache you will manage to repro again

ericdallo02:01:09

Starting Intellij from the CLI is the current workaround, but I would like to have something better, like a .zshsomething change or even better a fix in the plugin although I don't think its possible

markbastian15:01:46

Thanks for the tip on rm -rf .lsp/.cache. I’ll do that then give it another try sometime today.

markbastian03:01:08

@UKFSJSM38, do you know how I might completely reset the clojure-lsp-intellij plugin? I tried that rm -rf .lsp/.cache in my project after uninstalling the plugin completely. After restarting the plugin I get the following dialog and a hung background task saying "LSP: Initializing."

markbastian03:01:41

Here's the hung task:

markbastian03:01:32

Hmm, I also tried relaunching with ~/Applications/IntelliJ\ IDEA\ as well as opening a different project in case there was some kind of stale state. No matter what I try I can't get the LSP server to start.

markbastian03:01:43

Ok, looking at https://github.com/clojure-lsp/clojure-lsp-intellij/issues/25 now. I suspect that's my startup issue. I hadn't realized lsp was incompatible with Cursive. That might be it.

ericdallo13:01:41

Ah yeah, it's really incompatible with cursive (we are working on https://github.com/afucher/clojure-repl-intelli for the repl part), but I'm not sure the initializing issue is related with that, it's a high prior for me, but don't how why it happens (you are the second person with that), maybe it's something with Intellij Ultimate :thinking_face: I only have community to develop

ericdallo16:02:53

Hey @U0JUR9FPH, I'm still trying to fix https://github.com/clojure-lsp/clojure-lsp-intellij/issues/26 but no luck, I'd like to know if the .zshenv change you did solve the problem or if you are having any other problem yet with latest plugin version

markbastian16:02:07

I was never able to get past that initialization task so I couldn't get to where I could try it out.

markbastian16:02:12

Let me give it another run -- probably this evening.

ericdallo16:02:01

thanks, I tried to setup a mac in a virtual box env but without success yet