Fork me on GitHub
#emacs
<
2022-05-17
>
joshmiller22:05:12

Does anyone have any tips for excluding files from LSP’s file watchers in a project? For example, I don’t need the node_modules folder to be watched in a Clojurescript project, and it’s big enough that it causes warnings about performance when it starts up.

joshmiller22:05:44

Specifically, with

(with-eval-after-load 'lsp-mode
  (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]\\node_modules\\'"))

joshmiller22:05:28

That doesn’t seem to have worked. And ideally, I would add these to .dir-locals.el on a per-project basis.

joshmiller22:05:14

My .dir-locals.el now looks like ((nil . ((lsp-file-watch-ignored-directories . ("/node_modules$")))))

ericdallo22:05:51

Almost sure lsp-mode already have node_modules excluded

joshmiller22:05:49

It’s possible. There are a bunch of folders in that project that I excluded but left out of the example for brevity, so I might have ended up duplicating node_modules.