lsp

:clojure-lsp: Clojure implementation of the Language Server Protocol: https://clojure-lsp.io/
ericdallo 2021-06-28T11:55:16.242500Z

:clojure-lsp: We now have a Github Sponsors profile page 🙂 https://t.co/eIjlaMSDUo?amp=1

🤘 3
practicalli-john 2021-06-28T12:53:04.248Z

When running clojure-lsp and a REPL in Emacs (27), creating a new file automatically adds the namespace of that file twice. Is this a known feature and any suggestions about avoiding this? I've tried this on a Clojure as well as a ClojureScript project, both running Clojure CLI tools (although I doubt that makes a difference) I usually have the REPL running most of the time, so my default approach would just be to switch this feature off in the LSP config.

ericdallo 2021-06-28T12:55:08.248200Z

This is a known conflict of clojure-lsp with clj-refactor, you can avoid it disabling one of them, like said here: https://emacs-lsp.github.io/lsp-mode/tutorials/clojure-guide/#refactorings on *Conflict with clj-refactor when creating new files*

ericdallo 2021-06-28T12:56:10.248800Z

I suggest disabling on clj-refactor as the clojure-lsp doesn't need a REPL for that feature 🙂

practicalli-john 2021-06-28T13:01:58.249Z

Hmm, I am not (knowingly) running clj-refactor and havent done for a while. I wonder if its crept in somewhere. I certainly dont have clj-refactor in my deps.edn file or in any of the aliases I use to run the repl process on the command line. Maybe something has changed in the Cider middleware and that is pulling it in, but that seems unlikely.

ericdallo 2021-06-28T13:02:28.249200Z

clj-refactor is a emacs package

practicalli-john 2021-06-28T13:07:42.249400Z

Using this config from the lsp docs didnt make any difference even after reboot 😞

(setq cljr-add-ns-to-blank-clj-files nil)

ericdallo 2021-06-28T13:08:05.249600Z

Hum, odd, let me double check

ericdallo 2021-06-28T13:10:45.249800Z

I confirmed this issue, probably cider or clj-refactor or something changed that is causing that, I'll take a closer look

practicalli-john 2021-06-28T13:16:36.250Z

I've explicitly set clj-refactor to not be included as a package. Used the setting above too. I still get the same error, even without the REPL running... must be something else causing it. I'll try disable lsp with that config and see if it still does that

ericdallo 2021-06-28T13:17:58.250200Z

it seems a lsp-mode bug sending didOpen request twice, I'll check with lsp-mdoe folks but I'll do a fix on clojure-lsp to be idempotent as well

👍 2
ericdallo 2021-06-28T14:36:10.250600Z

@jr0cket fixed on master on lsp-mode, I should release a fix for clojure-lsp in next release, thanks for the report

👏 2