I suspect I'm missing something very obvious, but I'd appreciate guidance on how best to debug it.
I have a project that includes a number of command-line utilities used during development. These are in a subdirectory which is included via :extra-paths in a :util alias. I've added that alias to the LSP configuration with the following .lsp/config.edn:
{:source-aliases #{:dev :test :util}}
But, when I do Find All References in the editor, it doesn't show references within the utility code.
What's the best way to work out why things aren't working the way I expect?Everything does work as expected if I use :source-paths in config.edn, which I guess would be OK. But I'd still love to understand why :source-aliases isn't behaving as I expect.
source-aliases should work and it's the best setting for that
try checking https://clojure-lsp.io/troubleshooting/#server-log to check what clojure-lsp is using and the command it's running to get the classpath
Thanks @ericdallo. The logs showed that the util directory wasn't showing up correctly. But after deleting .lsp\.cache it worked exactly as I'd expect.
How/when is the cache invalidated? I would imagine that it should be invalidated whenever the configuration changes, but that doesn't seem to be the case?
it should be invalidated if any change in deps.edn but not sure about changes in config, maybe we should. Also make sure you are using latest clojure-lsp
Yup, I'm running clojure-lsp 2025.06.13-20.45.44
I think invalidating the cache on config change would have saved me some heartache (and might do the same for others)? I could see about putting a PR together?
sure! let's start with a issue so we can discuss the changes and behavior
Sounds good. I'll see if I can create a minimal project that reproduces the problem which we can use to test any solution against too.