lsp

paulbutcher 2025-06-27T08:34:50.731009Z

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?

paulbutcher 2025-06-27T08:42:37.641369Z

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.

ericdallo 2025-06-27T12:03:39.115479Z

source-aliases should work and it's the best setting for that

ericdallo 2025-06-27T12:04:10.778549Z

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

paulbutcher 2025-06-27T12:35:10.946529Z

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?

ericdallo 2025-06-27T12:39:44.962549Z

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

paulbutcher 2025-06-27T12:44:09.838029Z

Yup, I'm running clojure-lsp 2025.06.13-20.45.44

paulbutcher 2025-06-27T12:44:48.488639Z

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?

ericdallo 2025-06-27T12:45:59.134529Z

sure! let's start with a issue so we can discuss the changes and behavior

paulbutcher 2025-06-27T12:46:53.821869Z

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.

👍 1
paulbutcher 2025-06-28T09:05:14.329879Z

https://github.com/clojure-lsp/clojure-lsp/issues/2081