I'm getting this error when using Calva in a new little babashka project:
LSP classpath lookup failed when running `bb print-deps --format classpath`. Some features may not work properly if ignored. Error: Cannot run program "bb" (in directory "~/repos/digitized-scores/automation"): error=2, No such file or directory
bb is definitely on my path when I run a shell, but I wonder if it's not getting added to the path of whatever way clojure-lsp is running that command. Is there I can peek at how clojure-lsp is running that command?Clojure-lsp runs that using http://clojure.java.io https://github.com/clojure-lsp/clojure-lsp/blob/master/lib%2Fsrc%2Fclojure_lsp%2Fclasspath.clj#L69
Probably the PATH/shell used by calva when spawning clojure-lsp was not right, clojure-lsp prints the PATH used when that error happens, check server logs
Depending on how you start VS Code it could have a different environment than you have in the shell. Try starting code from the shell.
Itโs a classic. Many years ago (like 15 or so) a StackOverflow answer helped me with a mysterious error some users of an Eclipse plugin of mine encountered. Same thing. Eclipse was started with some crippled environment when started from the Windows start bar.
there are plans to improve that experience on clojure-lsp soon, like improve the message or even customize it by project/org
I should be looking at error messaging in Calva too.
I want to improve that as close as possible to clojure-lsp since other editors face the same problem, leave as few changes on editors as possible
That makes total sense. Usually Calva doesnโt touch clojure-lsp messages. I was more reflecting on Calva error messages in general. They are not always as helpful as they should be.
hi, after updating a git dependency, I had to clear the .lsp/ dir to get lsp to point me to the function defs of the new version , restarting was not enough. created a little bit of confusion.
I found some issues in clojure-lsp regarding handling new and removed files, issue https://github.com/clojure-lsp/clojure-lsp/issues/2046
clojure-lsp is supposed to understand changes outside the editor via the files-watches feature, but the editor must send those requests
what editor you using?
calva
It supports it, there is a chance to be a bug in clojure-lsp on how to handle it, if you manage to repro in a small sample repo that would help finding the issue
ah ok, i edited the deps.edn outside of calva. would lsp detect the change then? when i think about it, i also updated calva and reloaded the editor window, maybe that interfered
if the change is a deps change, no, clojure-lsp only analyses the classpath during startup, if the change is a clojure file, then it should re-analyze it
but then i was surprised that restarting lsp was not enough
restart should be enough, clojure-lsp takes a sha of deps.edn file, if anything changes it re-analyzes the classapth when starting
ok, who knows what happened then, maybe i'll have the time to repro later, thanks for your help!