lsp

Felipe 2026-05-27T13:22:32.176999Z

I work with a pretty large monorepo and every time I switch branches I feel like LSP gets stuck, as CPU usage goes to 100% and never drops. I've been doing rm -rf .lsp/.cache followed by lsp-workspace-restart, which gets LSP to initialize successfully after a minute, but is there a way to understand what's going on?

ericdallo 2026-05-27T13:26:13.465699Z

Yes, this is likely file watch, lsp-mode has the file watch feature which allows to listen to file changes outside the editor and tell LSP server which files changed so the server can analyze and keep consistent, if you disable that you may have outdated analysis of files which may be fine, you can opens the changed files manually if needed or restart lsp

ericdallo 2026-05-27T13:26:27.360909Z

Check lsp-filewatch-* variables

Felipe 2026-05-27T13:51:51.716289Z

hmmm I don't see anything in apropos

lassemaatta 2026-05-27T14:05:08.035139Z

:notify-references-on-file-change false is the trick I use, but the downside is that the analysis state in other files doesn't update immediately

👍 1
Felipe 2026-06-12T13:16:54.090969Z

I added :notify-references-on-file-change false to my .lsp/config.edn a week ago but I still see the CPU percentage explode when I switch branches 😕

ericdallo 2026-06-12T13:45:30.760939Z

will take a closer look how's that feature is working