Fork me on GitHub
#cider
<
2020-02-28
>
benedek09:02:14

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

achikin10:02:50

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

achikin11:02:01

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

benedek11:02:19

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

achikin11:02:50

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

benedek13:02:23

nice you just need the clojure-lsp server i suppose

benedek13:02:15

file:///android_asset/md/#installation

benedek13:02:39

haha this did not work

benedek13:02:11

install section

jr0cket16:02:26

@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).

dpsutton16:02:07

slow startup but efficient and speedy for me

jr0cket16:02:54

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

benedek16:02:13

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...

jr0cket16:02:30

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

dpsutton16:02:01

(use-package lsp-mode
  :init
  (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)
  :config
  (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)
         :map
         cider-mode-map
         ("C-c C-l" . lsp-clojure-refactor-menu/body)))

dpsutton16:02:20

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?

papachan21:02:03

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.

bozhidar08:02:17

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