My coworker and I have noticed some of the usage analysis/navigation features of Clojure LSP don't seem to update when we perform git pull --rebase. We often just restart our clojure-lsp session to get updated analysis data. Is this a known phenomenon? Could we be imagining it, and something else is causing the analysis to break? Happy to try to create a minimal example if this sounds like an unknown issue
Ah, it is exactly what caused my problem here! https://clojurians.slack.com/archives/CPABC1H61/p1741594519166179
I found some issues in clojure-lsp regarding handling new and removed files, issue https://github.com/clojure-lsp/clojure-lsp/issues/2046
*`lsp-enable-file-watchers`
there is definitely something broken on this feature indeed, but there are 2 key things to make that work:
• client (your editor) needs to have file watchers for when you switch branchs it notice those files were changed and send to LSP via didWatchedFilesChanged request, some editors like Emacs have a limit of those file watchers per performance reasons
• server - clojure-lsp needs to receive those batch of requests and analyze the files and their related, I believe here there must be missing something although things were supposed to work.
Would be really helpful if you could provide a clojure-lsp issue + a minimal repro like https://github.com/ericdallo/clojure-sample
Ah thanks for the hint. That is good intuition. I will try to squirrel away some time to try to isolate this. Perhaps it is a deeper issue with Emacs lsp-mode .
there is lsp-enable-file-watch and lsp-file-watch-threshold variables for lsp-mode