Fork me on GitHub
#emacs
<
2022-02-23
>
diego.videco20:02:30

Does anybody experience some laggyness in the editor when using lsp-mode? I am particularly having issues with paredit. E.g. barf goes from being immediate to taking (what feels like) at least 300ms. Getting this messages during every edit:

LSP :: Applying 1 edits to `server.clj' ...
Applying 1 edits to `server.clj' ...done 

ericdallo20:02:57

maybe it's related with the fact that every time you use pareit with lsp-mode, by default lsp-mode call textDocument/formattingRange , which is not a really fast operation on clojure-lsp, causing this lag. You can disable this behavior though, just not recall the variable to set

ericdallo20:02:53

You can confirm this behavior checking lsp-mode logs, check https://emacs-lsp.github.io/lsp-mode/page/troubleshooting/#lsp-log

diego.videco20:02:47

I see this:

Cancelling textDocument/codeLens(14) in hook after-change-functions
Cancelling textDocument/documentHighlight(12) in hook after-change-functions

ericdallo20:02:19

this seems not related

diego.videco20:02:20

hmm, that’s all I see

ericdallo20:02:12

Did you opened lsp-log? with lsp-workspace-show-log ?

diego.videco20:02:32

no, just went into the *lps-log* buffer. lsp-workspace-show-log returns IO logging is disabled

ericdallo20:02:18

as mentioned on the link aboce, you need to enable lsp-log-io variable

diego.videco20:02:04

I see it now. Yes, textDocument/formattingRange is there.

diego.videco20:02:09

So how could I find how to disable it? Can’t find anything online or on the emacs-lsp repo related to textDocument/formattingRange .

ericdallo20:02:05

I think I found it, it's lsp-enable-indentation

ericdallo20:02:08

set it to nil

diego.videco20:02:32

yeah, it works!

Alex Miller (Clojure team)20:02:18

Just a reminder that the State of Clojure 2022 survey https://www.surveymonkey.com/r/clojure2022 is open and to make sure you register your use of Emacs (Question #20)

💯 9