lsp

Max 2025-04-15T00:10:41.895449Z

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?

ericdallo 2025-04-15T00:30:47.867279Z

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

pez 2025-04-15T05:54:47.965259Z

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.

Max 2025-04-15T15:36:44.965509Z

Oooo @pez that was it! Thank you for the tip

๐Ÿ™ 1
pez 2025-04-15T16:01:26.776219Z

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.

ericdallo 2025-04-15T16:02:20.795789Z

there are plans to improve that experience on clojure-lsp soon, like improve the message or even customize it by project/org

pez 2025-04-15T16:03:14.301619Z

I should be looking at error messaging in Calva too.

ericdallo 2025-04-15T16:04:48.532209Z

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

pez 2025-04-15T16:17:52.374119Z

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.

๐Ÿ‘ 1
Bastian 2025-04-15T14:05:00.363879Z

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.

ericdallo 2025-05-16T13:31:38.073729Z

I found some issues in clojure-lsp regarding handling new and removed files, issue https://github.com/clojure-lsp/clojure-lsp/issues/2046

ericdallo 2025-04-15T14:05:55.607859Z

clojure-lsp is supposed to understand changes outside the editor via the files-watches feature, but the editor must send those requests

ericdallo 2025-04-15T14:06:02.289239Z

what editor you using?

Bastian 2025-04-15T14:06:41.180529Z

calva

ericdallo 2025-04-15T14:07:16.956689Z

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

Bastian 2025-04-15T14:10:20.297749Z

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

ericdallo 2025-04-15T14:12:08.508939Z

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

Bastian 2025-04-15T14:12:47.320369Z

but then i was surprised that restarting lsp was not enough

ericdallo 2025-04-15T14:13:18.216239Z

restart should be enough, clojure-lsp takes a sha of deps.edn file, if anything changes it re-analyzes the classapth when starting

Bastian 2025-04-15T14:14:18.222159Z

ok, who knows what happened then, maybe i'll have the time to repro later, thanks for your help!

๐Ÿ‘ 1