Fork me on GitHub
#lsp
<
2021-02-23
>
jumar05:02:46

Hi, I'm considering trying clojure-lsp and I'm wondering how well it plays with Cider and possibly other packages, particularly in Spacemacs. E.g. auto-completion looks like the thing that could clash. Are you using them together? If so are there any issues? And what's your most favorite lsp feature missing in Cider that you cannot live without? ๐Ÿ™‚

Lucy Wang15:02:38

1. In cider you always must eval the code before you can jump to the definition, but with lsp it's there as you type it 2. cider's refactor, clj-refactor doesn't work well in my environ, not sure why, but lsp-clojure's refactor works out of the box (I mostly use ns/function level rename) 3. If you connect to a repl running in a remote machine cider's jump to definition may not work depending on the project location in remote v.s local path. But with lsp it doesn't matter.

yes 3
ericdallo15:02:08

Most clj-refactor features doesn't work well for me in medium/big projects

jumar20:02:09

I use cljr-add-import-to-ns , cljr-add-require-to-ns, and cljr-add-missing-libspec all the time and they work well. But things that require whole project evaluation break - e.g. cljr-rename-symbol

ericdallo20:02:05

yeah, lsp code actions should handle the add-* ๐Ÿ™‚ and the LSP rename works perfect

borkdude08:02:44

As for conflicts: I am using both but Iโ€™m not aware of any conflicts, there might be but they havenโ€™t interrupted with my dev yet

ribelo08:02:20

I can't get over how well this all works. Seriously guys, marriage of clj-condo and lsp is the best thing since sliced bread.

๐Ÿ‘ 9
ribelo08:02:31

Thanks @borkdude & @ericdallo

โค๏ธ 9
borkdude08:02:10

Let's not forget @snoe, the man who started this project :)

โ˜๏ธ 3
ribelo08:02:39

ah, thanks @snoe, you're the best!

ericdallo12:02:03

@jumar Yeah, they work together, at least for doom-emacs, completion will use LSP and when Cider is on, it'll use Cider completions. You can control to use LSP completion instead of Cider with (setq lsp-enable-completion-at-point t). For more information https://emacs-lsp.github.io/lsp-mode/tutorials/clojure-guide/. BTW My favorite feature are the https://clojure-lsp.github.io/clojure-lsp/features/#code-actions๐Ÿ™‚, especially clean-ns and add-missing-*

mikejcusack00:02:44

Doesn't that do the opposite? Doesn't that disable LSP completion?

ericdallo00:02:16

Oh yeah, fixed it, thanks!

๐Ÿ‘ 3
borkdude12:02:15

This is probably also one of my favorites: find the definition for a local: https://twitter.com/borkdude/status/1364194077105872896

catjam 3
Lucy Wang15:02:38

1. In cider you always must eval the code before you can jump to the definition, but with lsp it's there as you type it 2. cider's refactor, clj-refactor doesn't work well in my environ, not sure why, but lsp-clojure's refactor works out of the box (I mostly use ns/function level rename) 3. If you connect to a repl running in a remote machine cider's jump to definition may not work depending on the project location in remote v.s local path. But with lsp it doesn't matter.

yes 3
dpsutton15:02:04

(for #3 there's cider-path-translations to help with that)

Lucy Wang00:02:01

ah right I remember that, but what if the remote process is simply a jar without the source code there?

dpsutton00:02:39

not sure. haven't tried that use case. i think it only does the prefix of the path so if the jar stuff could just be mangled and chopped to match the local directory it could work