DigressEd.net

Ocasional Digressions

When clojure-lsp is behaving weird

Ran into a weird situation where clojure-lsp in Emacs behaved strangely only when working on one particular repo. While function reference counts were shown, no tests were. In fact, tests were getting included in the reference count. A colleague loaded the same project and everything was working normally so it was definitely some configuration on my end.

I could see clojure-lsp reported all other repos used their root correctly (all created and used the repo's .lsp/.cache) except for this particular one, which was instead creating and using a cache one parent up and I could not understand why.

Of course, it all ended up being looser-error as I discovered I must have inadvertently told lsp to not include the repo's root in its watch list. I didn't know where clojure-lsp tracked its session list but got it by getting the value of lsp-session-file, which pointed to ~/.emacs.d/.lsp-session-v1. In there I found the repo's path was included in the second list which contains ignored paths. Removing it from the list forced lsp to prompt me again after a lsp-restart-workspace and everything behaved as expected from then on.

Published: 2023-10-09

Tagged: clojure emacs clojure-lsp

Archive