Fork me on GitHub
#lsp
<
2023-11-11
>
ericdallo17:11:43

I need a Macos brew user willing to test a clojure-lsp-intellij fix, LMK in the 🧵 if wanna help

ericdallo17:11:31

It's a issue with macos users where clojure-lsp-intellij can't find lein or clojure during classpath lookup on server startup

ericdallo17:11:22

First thing is to confirm you have the issue: • install latest clojure-lsp-intellij plugin from jetbrains marketplace • make sure you have lein or clojure installed via brew • run rm -rf .lsp/.cache in a lein or deps.edn project • open that project with intellij and confirm during classpath lookup you receive a message saying classpath lookup failed because can't find lein or clojure

lread15:11:34

Did you ever get the macOS testing help you needed here @UKFSJSM38?

ericdallo15:11:19

yes @U04HQGN8QCV helped me, but I still can't find the env issue 😔

lisphug 1
Robert Wood12:11:53

I have encountered a similar sounding issue via Calva. Anything I had installed via brew seemed unavailable to calva on startup. It would give issues like the below picture. Even though /opt/homebrew/bin etc was on my path. And the relevant binaries were there. (And available in vscode’s inline terminal) The workaround solution for me was to add /opt/homebrew/bin to the /etc/paths file which then solved the problem. I still don’t fully follow how it all hooks together. But that might give you some breadcrumbs to follow? If I have a bit of time later I will install IntelliJ and see if I can replicate.

ericdallo12:11:42

Thank you vry much @U0349R5BALA I haven't tried that yet and have no clue why that would work as well, but what I researched so far: MacOS launcher GUIs (finder, spotlight etc) launches apps with a completly empty shell, not even the bash one, and that cause programs to not have the same PATH env that you have on zsh, bash etc, that's why launching vscode, intellij etc from your terminal usually fixes the issue. This is explained on this Intellij class https://github.com/JetBrains/intellij-community/blob/master/platform/util/src/com/intellij/util/EnvironmentUtil.java#L72, I'm using that for clojure-lsp-intellij but it's not working yet, will try your suggestion (actually ask someone to try as I don't have a mac hehe)

Arthur Fücher12:11:33

I tried here to add homebrew to etc/paths but got the same error

😔 1
ericdallo12:11:11

Did you need to restart your mac @U0349R5BALA?

Robert Wood12:11:33

I think I did. And just to confirm did you add both /bin/ and /sbin/? like so:

robertwood@Roberts-MBP storage % cat /etc/paths
/opt/homebrew/bin
/opt/homebrew/sbin
/usr/local/bin
/System/Cryptexes/App/usr/bin
/usr/bin
/bin
/usr/sbin
/sbin

☝️ 1
Arthur Fücher12:11:59

hmm no! let me try again with both paths, and restart it

🤞 1
Arthur Fücher12:11:54

arthur.fucher<@U0EL66M19> ~ % cat /etc/paths
/usr/local/bin
/System/Cryptexes/App/usr/bin
/usr/bin
/bin
/usr/sbin
/sbin
/opt/homebrew/bin
/opt/homebrew/sbin