This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-04-05
Channels
- # announcements (7)
- # beginners (10)
- # calva (14)
- # clj-otel (8)
- # clojure (42)
- # clojure-europe (20)
- # clojure-nl (1)
- # clojure-norway (22)
- # clojure-spec (8)
- # clojure-uk (7)
- # core-async (10)
- # cursive (1)
- # events (1)
- # hyperfiddle (20)
- # introduce-yourself (1)
- # jobs-discuss (11)
- # lsp (48)
- # missionary (3)
- # music (1)
- # off-topic (7)
- # overtone (9)
- # pedestal (21)
- # rdf (1)
- # releases (3)
- # shadow-cljs (22)
- # specter (13)
- # squint (1)
- # yamlscript (3)
on my Mac some refactorings (like clean-ns) take a very long time, even 30 seconds, I tried to run the profiler but don't see much
147 13% - funcall-interactively
139 13% - lsp-clojure-refactor-menu/lsp-clojure-clean-ns-and-exit
138 12% - progn
138 12% - hydra--call-interactively-remap-maybe
138 12% - funcall-interactively
138 12% - lsp-clojure-clean-ns
138 12% - lsp-clojure--refactoring-call
138 12% - lsp-clojure--execute-command
138 12% - lsp-send-execute-command
138 12% - lsp-workspace-command-execute
138 12% - lsp-request
117 10% - accept-process-output
99 9% - timer-event-handler
99 9% - apply
99 9% - auto-revert-buffers
99 9% - apply
99 9% - auto-revert-buffers--buffer-list-filter
37 3% - #<subr auto-revert-buffers>
32 3% + auto-revert--buffer-candidates
3 0% + auto-revert-buffer
has anyone noticed something similar
could you try from the terminal to make sure it's not a editor issue:
clojure-lsp clean-ns
in your project rootI also noticed that I might be using an old versioin, since the homebrew is much older than the one that emacs downloads automatically
yep, use the official brew tap https://clojure-lsp.io/installation/#homebrew-macos-and-linux
Executed in 10.48 secs fish external usr time 23.09 secs 48.00 micros 23.09 secs sys time 1.28 secs 770.00 micros 1.27 secs time clojure-lsp clean-ns [ 99%] Project analyzed Checking namespaces... Nothing to clear! ______________________________________________________ Executed in 5.90 secs fish external usr time 18.05 secs 53.00 micros 18.05 secs sys time 0.63 secs 911.00 micros 0.63 secs
well it does take a while
even after the first run
time clojure-lsp clean-ns
[ 99%] Project analyzed Checking namespaces...
Nothing to clear!
________________________________________________________
Executed in 1.91 secs fish external
usr time 2.39 secs 0.06 millis 2.39 secs
sys time 0.25 secs 1.01 millis 0.25 secs
oh yeah better now
I wish we could remove that clojure-lsp from the homebrew core, it's outdated and maintainers don't want to remove it.
still takes a while actually, but I wonder if it's using the one in .emacs.d
ah wait, it actually ddoes the thing but
lsp-workspace-command-execute: 'workspace/executeCommand' with 'clean-ns' failed.
(error "Timeout while waiting for response. Method: workspace/executeCommand")
that's weird, make sure it's using the updated one with lsp-clojure-server-info
, it should print on messages buffer the server-version
:server-version "2024.03.31-19.15.11-nightly",
but yeah still happening even after I restarted Emacs
yeah looks like
weird that it says it times out but it still does it
Actually in case if someone uses mise or asdf I made plugin https://github.com/armed/asdf-clojure-lsp
ok I still haven't solved this issue, lots of refactoring timeout for some weird reason from Emacs
but others like rename are just perfectly fine
actually the rename is just lsp-rename
, probably all the ones starting with lsp-clojure-
are not actually working
Checking for Native JSON support: OK
Check emacs supports `read-process-output-max': OK
Check `read-process-output-max' default has been changed from 4k: OK
Byte compiled against Native JSON (recompile lsp-mode if failing when Native JSON available): OK
`gc-cons-threshold' increased?: OK
Using `plist' for deserialized objects? (refer to ): OPTIONAL
Using emacs 28+ with native compilation?: OK
the doctor also seems happy
well maybe I should enable plist as well
Cancelling textDocument/documentHighlight(53746) in hook after-change-functions
Cancelling textDocument/codeAction(53745) in hook after-change-functions
Cancelling textDocument/codeAction(53783) in hook after-change-functions
Cancelling textDocument/codeAction(53807) in hook after-change-functions
Cancelling codeLens/resolve(53806) in hook after-change-functions
Cancelling textDocument/codeAction(53816) in hook after-change-functions
Cancelling codeLens/resolve(53815) in hook after-change-functions
Cancelling textDocument/documentHighlight(53823) in hook after-change-functions
Cancelling textDocument/codeAction(53822) in hook after-change-functions
Cancelling codeLens/resolve(53821) in hook after-change-functions
Cancelling textDocument/documentHighlight(53826) in hook after-change-functions
Cancelling textDocument/codeAction(53825) in hook after-change-functions
Cancelling codeLens/resolve(53832) in hook after-change-functions
Cancelling textDocument/documentHighlight(53839) in hook after-change-functions
Cancelling textDocument/codeLens(53836) in hook after-change-functions
Cancelling textDocument/documentHighlight(53846) in hook after-change-functions
Cancelling textDocument/codeLens(53843) in hook after-change-functions
Cancelling textDocument/documentHighlight(53882) in hook after-change-functions
Cancelling textDocument/codeAction(53881) in hook after-change-functions
Cancelling codeLens/resolve(53972) in hook after-change-functions
I can see a bunch of these
Iām using GitLens by GitKraken VSCode extension and I found that clojure-lsp doesnāt interact well with it during rebases. When conflicts appear in the clojure source, Clojure LSP blocks the gitlens UI that shows Accept Current, Accept incoming, etc. conflict resolution links in editor. Stopping Clojure LSP immediately causes this UI to appear and work snappily. With Clojure LSP enabled, it works very slowly. Is it possible to automatically detect unresolved conflicts in clojure files and do not attempt to process them by Clojure LSP?
not sure how easy would be, also, not sure it's clojure-lsp fault or your editor's lsp client side
I guess youāre referring to Calva here?
Iām referring to this UI
cc @U0ETXRFEW thoughts on this?
Iām thinking that Calva could very well start acting up on broken structure. But you say that with clojure-lsp disabled it starts to work again. If I can get a repro I can investigate and see if there is something in the lsp-support from Calva that causes it. Well, I can try at least.
I think what is needed is a big clojure repository with many source files and projects. And both extensions. Also it is not completely blocking, it just making it very slow. I believe Clojure LSP is trying to catch up with the new changes applied in a rebase and until itās done, the UI is not refreshing. So Iām using āCalva Clojure LSP: Stop the Clojure LSP serverā in such situations to speed things up. Do you know any big open source repo I can try it with?
Penpot, http://status.im, metabase are the ones popping to mind.
LSP does have a file watch feature which the editor send to clojure-lsp all changed files outside the editor (because of a git rebase for example), then clojure-lsp analyze in batch the files, but that should be as fast or faster than analyzing the whole project when starting, sounds like we would need a good repro to undertand it better