Compatibility with clojure-lsp? #3434
Replies: 11 comments
-
Compatible in what sense? You can run an LSP server alongside nREPL if that's what you're asking for, but you'll have to be careful with
CIDER's backend is already portable, as nREPL is an open protocol and everything's just nREPL middleware. We can certainly implement LSP in terms of nREPL and provide a runtime-powered alternative to |
Beta Was this translation helpful? Give feedback.
-
I use lsp alongside of CIDER. They work fine together but i have the following config. It mainly makes CIDER in charge of indentation and completion. (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"))) |
Beta Was this translation helpful? Give feedback.
-
@dpsutton Alternatively you can disable the LSP indentation/completion when |
Beta Was this translation helpful? Give feedback.
-
@bbatsov oh i like that! i'm gonna switch it over |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding! |
Beta Was this translation helpful? Give feedback.
-
@dpsutton did you manage to make them play well together? |
Beta Was this translation helpful? Give feedback.
-
I'm trying to use LSP + Cider and one problem I see is that Cider redefines the key mappings for things like <M-.> and <C-.>. I'd prefer to be able to tell Cider not to be xref and imenu provider because I prefer LSP for that. |
Beta Was this translation helpful? Give feedback.
-
Hey all, I hope this helps :) |
Beta Was this translation helpful? Give feedback.
-
that's pretty cool, thanks. One problem I keep having is alternating the formatting between cider and lsp. I'm using latest stable releases for both while your example seems to use unstable versions? |
Beta Was this translation helpful? Give feedback.
-
Yes, @gdanov they should not conflict with each other AFAIK, lsp formatting is achieved via |
Beta Was this translation helpful? Give feedback.
-
lsp seems to be interacting with indent-region by advising it. Not sure how and why
|
Beta Was this translation helpful? Give feedback.
-
Is the functionality in CIDER compatible with https://github.com/snoe/clojure-lsp ? I figure that would allow all of the CIDER goodies to work across platforms/editors if it was under LSP.
Beta Was this translation helpful? Give feedback.
All reactions