Fork me on GitHub

Tried clojure-lsp for the past week and while nice over all, I spent some time fighting its eager indentation. For example, when adding something like this:

(let [foo something
And pressing RET to add another line, the point would be returned back to the end of the previous line. I’d continue to type and I’d add my code, so that at the end it’d end up looking like:
(let [foo something bar something-else]
I looked in the documentation, to see where I could tweak the settings for indenting, but I couldn’t find anything that would help me to resolve this issue. What should I be looking for to tweak the super eager indentation for clojure-lsp? Thanks


Not sure your issue is related with LSP, could you record a gif or a video? Not sure I understand what is happening


sounds odd, deleting newlines seems beyond the scope of indentation. might be electric-indent-mode? lispy-mode? (disclaimer: I don't know much about either)

☝️ 1

I experienced similar kinds of issues when using aggressive-indent-mode with cljfmt enabled through LSP. My guess would be electric-indent-mode and cljfmt triggering each other by the changes they are making. Try disable one of those and see if you have the same effects. In the end I switched off aggressive-indent-mode and just use the LSP formatting through cljfmt (although I have disabled some of the rules cljfmt has by default)


did anyone ever add babashka as an ob-clojure backend?


i saw that but the :shebang solution as noted does not put the source in clojure-mode, right? I'll dig into the code.