Fork me on GitHub
#spacemacs
<
2024-02-12
>
dumrat16:02:20

Is it normal that formatting .clj files is sluggish in the practicalli setup? When the file length grows to be around 80 lines, I've noticed this couple of times. Whenever I refactor something a bit, I can notice the slowness. If I format the entire document with , = = that too is slow (sometimes 2-3 secs or even more).

practicalli-johnny17:02:02

I haven't noticed anything myself. First think I would check is the clojure-lsp version being used by Emacs. Does having the repl running affect the speed of format (could be cider & clojure-clj fighting, but this is unlikely although easy to check) It could be native compilation, I found Emacs a bit slower for some things with it enabled. I compiled Emacs 29.2 without native-como at the weekend, so will give that a try this evening and see if I can replicate the format issue

👍 1
dumrat17:02:05

I have around 10 clj buffers open. Does that matter? I'm asking because quite new to spacemacs.

practicalli-johnny17:02:26

Usually it's very long linese.g 100s of characters. Or lots of line, e.g in a log buffer or repl buffer (although Practicalli sets a repl buffer line limit of 100 lines)

practicalli-johnny17:02:18

If Emacs is fast otherwise, then it's probably a package that's not behaving properly.

practicalli-johnny17:02:05

If you have some examples code to share that has the problem, I can test it out.

practicalli-johnny17:02:31

If there is general slowness it's usually the combination of a specific Emacs distribution and a specific Operating system

dumrat18:02:04

https://github.com/nakiya/htmx-examples-clojure I'm working on this and I have most of the clj files open I guess. Ubuntu 22.04, emacs v29.2, nproc = 8

practicalli-johnny18:02:15

I will give it a try after dinner. It could be htmlx aspects. Is there a difference between the speed of using , = b (which calls lsp-format-buffer ) and , = = (which calls cider-format-buffer )

👍 1
dumrat18:02:43

, = b says: LSP :: No formatting changes provided

dumrat18:02:48

, = b is instant

dumrat18:02:24

While , = = takes ~2 secs. First the entire buffer text coloring disappears and gets reformatted at the end.

practicalli-johnny19:02:05

I suspect there is something in the htmx examples code that trips up the Cider format, perhaps because its htmlx (although that is a guess). One way is to try a different Clojure project and see if the issue occurs there too. Or use , = b and avoid the issue.

practicalli-johnny20:02:16

I cant seem to emulate the issue, at least not in a way I notice. I guess would be that Clojure LSP is formatting the buffer after using , = = is used to format the buffer with Cider. Resulting in the code sense and syntax highlighting being refreshed.

practicalli-johnny20:02:18

Or it could be an issue with the LSP mode client, but that seems less likely. I suggest sticking with , = b and = r to format the buffer or region using LSP rather than Clojure. Or if not using Clojure LSP diagnostic and tools, disable Clojure LSP formatting.

👍 1
dumrat02:02:41

Thanks. Will try out.

dumrat03:02:32

I don't have time to check for a day or two, but if wanted to find out what's causing the sluggishness, how do I go about it? Any general pointers on debugging this kind of thing?

dumrat05:02:22

The sluggishness seems to have gone down a little bit. I reset my spacemacs and cleaned up some of my user customizations. But it's still not as snappy as I see people have in videos.

jumar21:02:07

When searching for a command, I'm not able to select anything that's in the second section - only ones in History. Neither arrow down nor C-n work. This used to work for me some time ago but it broke at same point. Even after I did a new installation,it's still broken. Anyone else experiencing the same problem? How can I debug it?

practicalli-johnny22:02:08

I'm using Emacs 29.2 and arrow keys or C-j & C-k navigate history and recent lists

jumar23:02:21

You don't use evil mode?

practicalli-johnny08:02:48

I am using Evil mode (for many years now). I wonder if the issue is related to the changes in helm-descbinds (although that seems unlikely). I will run another Spacemacs package and see if I can replicate the issue I think I'll pin an older version of helm-descbinds as it's still interfering with which-key (until the maintainer of that package stops actively breaking things)

jumar18:02:00

Thanks, I am eager to hear what you find

practicalli-johnny22:02:25

I havent been able to replicate the issue. I can use arrow keys, C-j , C-k, C-n & C-p to navigate the helm list. Maybe there is some issue with the .spacemacs (or .spacemacs.d) configuration being used. That is the only thing I can think of.

jumar06:06:11

I'm still suffering from this problem with navigation in helm buffers. The other place where it shows is list-buffers - as with commands, I enter a partial name and it shows some matches from open buffers. But I'm not able to move to the Recentf section at all. Pressing C-n / C-p only oscillates between the items in the Buffers section. I can jump to Create buffer via C-v or M-S-v

jumar06:06:11

I'm still suffering from this problem with navigation in helm buffers. The other place where it shows is list-buffers - as with commands, I enter a partial name and it shows some matches from open buffers. But I'm not able to move to the Recentf section at all. Pressing C-n / C-p only oscillates between the items in the Buffers section. I can jump to Create buffer via C-v or M-S-v