lsp 2026-01-02

I am occasionally getting this weird minibuffer (see screenshot)

It's mostly happening when I navigate to files that I haven't opened in lsp before - this time I got the 'import' buffer for a brand new project, and I hit i, and then this came up. I don't know where it came from, or what it means. I don't see any other messages any other buffers.

'Retry' causes the minibuffer to blink, and nothing else to happen. Ignore makes it go away, still unsure what it was. 🙂

Here's an odd line in *lsp-log* unsure if related:

Cancelling textDocument/codeLens(2336) in hook after-change-functions

it's quite weird that it's not showing the message content, but it's a message mentioning that clojure-lsp didn't manage to analyze your classpath with lein classpath or clj -Spath

you should fix it and not ignore probably otherwise you will face some clojure-lsp features not working like not being able to find dependencies etc

the message should look like: (it's weird your emacs not showing that)

Ah! Interesting. Yes. > clojure-lsp didn't manage to analyze your classpath with lein classpath or clj -Spath This makes sense because this brand new project only has shadow-cljs.edn (and does not use deps.edn or lein yet).

even so clojure-lsp supports that

oh, really. 🤔

try npx shadow-cljs classpath in your project and check if it works

maybe what is happening is emacs is not finding npx binary because of how you start emacs (the PATH env etc), we would know that if we saw the error message in emacs :/

Good idea! That does print a classpath 👍

try starting emacs from terminal just to check if it works

because via terminal, emacs will inherit your shell PATH and find npx

another test: M-x eval-expression (executable-find "npx")

oh ya $ emacs shadow-cljs.edn works.

yeah, so the problem is your emacs is not using your shell envs etc (one of the biggest headaches that I like doom-emacs to fix it for me hehe)

I believe this is the canonical way these days to solve that: https://github.com/purcell/exec-path-from-shell

Totally believable. I have battled this area before.

I hate this problem, I spent so many hours fixing that for intellij when creating clojure-lsp-intellij

I found that this is more common for macos users as well as mac starts apps from its launch with a pretty empty sh shell

Also interesting, I'm now no longer in the state where it's broken? Perhaps because when it worked once it cached some data?

yes, it caches classpath until you change anything in your shadown-cljs.edn file or remove the .lsp/.cache folder

That's very cool. Thanks for your help, I'm off and running.

👍 1