I’m still having problems with lsp-lens-mode
making smartparens commands e.g. slurp/barf etc intollerably slow (like several seconds).
I’ve set the lsp-idle-delay
to 1.0
and similarly for company-idle-delay
, is there anything else I can do?
lsp-lens should not affect that I think, does the issue only happen with lsp-lens-mode enabled?
to be honest I’m not too sure, it seems slowest with it… but also slower than it used to be without it
It could well be something else
- command-execute 785 95%
- call-interactively 785 95%
- funcall-interactively 785 95%
+ counsel-M-x 560 67%
- sp-forward-barf-sexp 136 16%
- sp--indent-region 126 15%
- indent-region 126 15%
- lsp-format-region 126 15%
- lsp-request 120 14%
- accept-process-output 1 0%
- timer-event-handler 1 0%
+ apply 1 0%
- lsp--apply-text-edits 6 0%
- mapc 6 0%
+ #<compiled 0x1fe085d5cab5> 6 0%
Is there a way to switch of lsp indentation support?
Yes
lsp-enable-identation or something like that
We have a issue about indentation performance on huge buffers
current buffer is maybe just 200 locs
ok setting that to nil seems to improve things
so maybe the issue is indeed the indentation, could you check the logs between server and client and see how much time is taking each server response
via lsp-workspace-show-log
BTW this can help as well: https://emacs-lsp.github.io/lsp-mode/page/performance/
I created a issue to solve this problem on cljfmt: https://github.com/clojure-lsp/clojure-lsp/issues/266
🙇 thanks
incidentally it seems sometimes my smartparen commands like slurp forward are now generating garbled states, is that a known issue?
not really, could you elaborate with a repro?
not sure I’ve only seen it in a proprietary code base at the minute… but it looks like the parser is generating a syntax error where there isn’t one
hmm actually there is an error, but it’s really a semantic one… i.e. an unbound var that I’m trying to slurp forward a let over…
I suspect the broken highlighting is because of that too
that’s the before state above… If I slurp forward the let vanishes
(after state)
hmm I fixed it up by hand but still got the syntax error, however closing and reopening the file worked
It’s weird though because lsp indentation should also now be disabled
ahh maybe I need to restart the workspace…
yeah, that's definitively is a out of sync clojure-lsp error 😞 the same issue we are discussing yesterday on the channel
at least now we have a way to repro, that always happen with smartparens actions?
They seem prone to it
not sure if it’s always the case
only started using lsp in the past few weeks; so I’m still figuring it all out
yeah, I could not repro using paredit
I wasn’t expecting formatting to be baked in
ok, I suppose I could switch back to paredit at somepoint
we still need to fix it somehow on clojure-lsp side, but if you could test with paredit just to check if that makes any difference, would help a lot
I need to repro the issue to understand how to fix it
i'm getting lots of out-of-sync issues requiring reopening the buffer.
😕 Do you have a repro?
Maybe we will need to disable that by default
no, but using it for longer than 20 minutes i kinda can't not run into it
i made a function
(defun personal/kick-it ()
(interactive)
(let ((b (buffer-file-name (current-buffer))))
(save-buffer)
(kill-buffer)
(find-file b)
(inf-clojure-minor-mode)))
yeah, we need to understand when that happens, I suspect is related with some specific client changes, like a change with iedit
, smartparens
and etc
:clojure-lsp: Released 2021.03.16-20.28.06
version
• Fix server not analyzing after a wrong code on cljs files - https://github.com/clojure-lsp/clojure-lsp/pull/367
• Rollback incremental didChange
adding a new :text-document-sync-kind
setting with :full
as default. Check https://clojure-lsp.github.io/clojure-lsp/settings/for more details
This release should fix the out of sync issues until we make the incremental changes stable.
Could you try latest release?
https://clojurians.slack.com/archives/CPABC1H61/p1615928058014500
one thing i remembered i had was the semantic tokens turned on, but i never really saw any benefit
i just turned it off, and gonna try it out to make sure that wasn't it
The semantic tokens should not affect that, they are only visual
also, clojure-lsp only support macros, but I'll add support for other things like functions calls etc just like CIDER add colors when repl is on
goodness
that's weird that it would highlight the f function binding and the entire call site
Yeah, I think that is another issue when you have a local variable that is a function call
I think it's a clj-kondo analysis range issue, but I need to test it locally and confirm that
ah ok
feeling better after upgrading
nice 🙂