Fork me on GitHub
#lsp
<
2021-10-18
>
andrea.crotti09:10:03

in the last few weeks I noticed a very annoying behaviour, sometimes opening a file takes a very long time with lsp enabled

andrea.crotti09:10:34

I think it's related to the fact that even if all the files I open are inside git projects, sometimes it asks me if I want to index the whole $HOME

practicalli-johnny09:10:03

Do you have a $HOME/.git directory? Perhaps what ever detects the root of the project is seeing that as the top level of the project

andrea.crotti09:10:06

it just happened again

andrea.crotti09:10:18

can't really find a pattern yet

andrea.crotti09:10:57

which is quite weird, any idea what could confuse LSP to try to index things outside of the projects I open?

andrea.crotti09:10:13

ah I just did some profiling in Emacs actually and I think it was actually global-linum-mode to lock forever 😮

andrea.crotti09:10:35

it didn't use to do that though, weird

mpenet10:10:17

You could replace linum with the built-in, unless you are using linum because you're stuck on an old emacs

mpenet10:10:56

The built-in is much faster

mpenet10:10:10

display-line-numbers-mode

andrea.crotti12:10:50

ah yeah coudl do that, but tbh I probably don't even need it

andrea.crotti12:10:06

with Clojure is not like files are that long anyway

ericdallo12:10:57

@andrea.crotti also make sure lsp-mode is using the correct project root of your project and not your home. M-x lsp-workspace-folders-remove and remove home if exists and your project then M-x lsp and import the correct project root

andrea.crotti12:10:26

ahh yes it was there

👍 1
Drew Verlee17:10:39

Where do i go to set the variables lsp-enable-file-watchers' and lsp-file-watch-threshold' ? From this warning:

Watching all the files in /home/drewverlee/archmedx/kyber would require adding watches to 2254 directories, so watching the repo may slow Emacs down.
Do you want to watch all files in /home/drewverlee/archmedx/kyber? (y or n) y
LSP :: You can configure this warning with the `lsp-enable-file-watchers' and `lsp-file-watch-threshold' variables

ericdallo17:10:47

you add to your init.el:

(setq lsp-enable-file-watchers nil)

Drew Verlee17:10:58

unrelated question, the instructions here for installing a a cljs debugger seem to assume your using VS code for some reason? https://emacs-lsp.github.io/lsp-mode/tutorials/debugging-clojure-script/#debugging