Fork me on GitHub

@achikin clojure-lsp has it btw, wo/ a repl too. worth a try, good to use side by side with cider


@benedek didn’t know it exists, thank you. I’ll give it a try.

👍 1

@benedek are there any instructions regarding clojure-lsp setup in Spacemacs?


no idea I am afraid, I use vanilla emacs. is it available in spacemacs at all?


Yes it is. Spacemacs has an lsp layer, which consists of lsp-mode and lsp-ui


nice you just need the clojure-lsp server i suppose




haha this did not work


install section


@benedek some reports of LSP being slow for Clojure on the Spacemacs Gitter channel. Would be interesting to know if anyone has this working very efficiently for Clojure. (although I find CiDER plenty fast enough and always run a REPL).


slow startup but efficient and speedy for me


Is there a config for LSP and Clojure you can share ?


hm.. i use it regularly and have not experienced any slowness. that said i use it in parallel with cider/repl so i might not have noticed...


On a different note, Is there a function in CIDER to jump to the end of line and evaluate the last s-expression, similar to lisp-state-eval-sexp-end-of-line . I couldnt find anything that specifically did that, although it sounds quite common to use it in Emacs lisp. I suppose something like cider-eval-sexp-end-of-line


(use-package lsp-mode
  (setq lsp-clojure-server-command '("bash" "-c" "cd ~/projects/clojure/clojure-lsp && lein run"))
  (setq lsp-enable-indentation nil)
  (setq lsp-enable-completion-at-point nil)
  ;; (setq indent-region-function #'clojure-indent-function)
  (add-hook 'clojure-mode-hook #'lsp)
  (add-hook 'clojurec-mode-hook #'lsp)
  (add-hook 'clojurescript-mode-hook #'lsp)
  (require 'lsp-clojure)
  (add-to-list 'lsp-language-id-configuration '(clojure-mode . "clojure"))
  (add-to-list 'lsp-language-id-configuration '(clojurec-mode . "clojure"))
  (add-to-list 'lsp-language-id-configuration '(clojurescript-mode . "clojurescript")))

(use-package lsp-clojure-hydra
  :after (lsp-mode lsp-mode cider)
  :load-path "~/projects/elisp/lsp-clojure-hydra"
  :bind (("C-c C-l" . lsp-clojure-refactor-menu/body)
         ("C-c C-l" . lsp-clojure-refactor-menu/body)))

👍 2

i made a hydra for lsp that i need to get onto elpa

Eamonn Sullivan18:02:24

Apologies in advance for a dumb newbie question, but eldoc has stopped working for me in cider. I have (clojure-mode . turn-on-eldoc-mode) in my init. I also have (emacs-lisp-mode . turn-on-eldoc-mode) and eldoc is working fine in elisp buffers. If I try to manually M-x eldoc-mode in a clojure buffer, I get "There is no ElDoc support in this buffer". I have started cider (jacked in) and C-c C-k to load the code in the buffer. This was working fine recently (i think -- like 99% sure. I really like the eldoc hints, so I'm sure I would have noticed it missing). Can anyone think of anything I'm missing?


thank you for sharing. my config is a little bit too old when clj-kondo wasnt existing already, will try your config, seems to be promising.


Btw, eldoc is enabled by default in recent versions of Emacs. There’s no need to turn anything on explicitly anymore.