Fork me on GitHub
#lsp
<
2023-03-05
>
practicalli-johnny21:03:09

[Emacs] I've been experiencing a conflict between what seems to be clojure-mode and LSP-mode when clojure-toplevel-inside-comment-form is set to true (a few others have also had this issue) When moving the cursor around or editing within a (comment ) form the Emacs process will jump to 100% and the cursor freezes. C-g pressed many times will kill what ever process is going awry When I use clojure-mode with clojure-toplevel-inside-comment-form without LSP server running, all is fine. Using LSP with clojure-mode and clojure-toplevel-inside-comment-form set to nil (or just not set as its not a default) seems to be just fine. Any thoughts as to what could be causing the conflict? Is this a known issue?

hiredman22:03:56

https://github.com/clojure-emacs/clojure-mode/issues/639 looks to be related (looks like they can't get it to reproduce), doesn't explicitly mention lsp, but the backtrace contains some lsp functions, so seems to be involved

practicalli-johnny23:03:26

Thanks for the links, very useful.

ericdallo10:03:36

I think lsp-mode uses some functions to get current point or defun and end up using indirectly that clojure-mode function which has that performance issue

practicalli-johnny12:03:46

For the moment I've disabled that clojure-mode feature by setting the variable to nil (the default) and will evaluate code in a comment form via the last sexp command rather than defun command (placing the cursor at the start of the next line after the expression)

practicalli-johnny12:03:44

After removing the lsp hover functionality by setting lsp-eldoc-enable-hover nil in the Spacemacs LSP layer variables, I enabled the top level form evaluation in clojure-mode clojure-toplevel-inside-comment-form t and no longer have the issue. Thank you. https://clojurians.slack.com/archives/C06MAR553/p1678711999725459