Fork me on GitHub
#lsp
<
2021-06-28
>
ericdallo11:06:16

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

metal 9
practicalli-johnny12:06:04

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.

ericdallo12:06:08

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*

ericdallo12:06:10

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

practicalli-johnny13:06:58

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.

ericdallo13:06:28

clj-refactor is a emacs package

practicalli-johnny13:06:42

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

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

ericdallo13:06:05

Hum, odd, let me double check

ericdallo13:06:45

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

practicalli-johnny13:06:36

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

ericdallo13:06:58

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

👍 6
ericdallo14:06:10

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

👏 6