Fork me on GitHub

I've now got clojure-lsp configured with intellij and I'd like code->reformat within a file to use clojure-lsp format instead of Cursive's formatting... and failing to see if that's possible. Or if there is some way to import clojure-lsp's formatting style into cursive that'd also work for me. Thanks


there is an lsp option to 'always send requests' which apparently should mean the ide sends the command to the lsp even if the ide/plugin supports it already. but that doesnt seem to work for formatting afaict


It'd be nice to have that option on cursive :)


cljfmt could be just bundled with Cursive directly, since it's written in Clojure too, BUT 1. how well does it deal with invalid Clojure syntax? 2. how would the cursor position survive the reformatting? 3. how would the formatting of selections work? (alignment-wise, relative to the context of the selection)


My plan here is to have an easy way to configure the Cursive formatter to be cljfmt-compliant. It’s actually hard to use an external formatter in IntelliJ since the formatting is deeply integrated in areas you wouldn’t expect (for example, when you press enter, where the caret should move to is calculated using the formatter). I’m interested to hear about cases where the current Cursive formatting can’t be made cljfmt-compliant, or other differences that are annoying.


Importing a cljfmt spec and configuring Cursive appropriately is an obvious requirement that isn’t there currently.


Sounds awesome 👍


I’ve got a project that has project.clj and pom.xml . The pom.xml is the sideeffect of making a jar, but the IntelliJ complains that Maven and Leiningen cannot both manage the project and it keeps preferring Maven. Is there a way to fix this?


I think what you need to do is unregister the project with Maven. In your Maven toolwindow, remove the registered project there, and then make sure that it still appears in your Leiningen toolwindow. If it doesn’t, you might need to re-import the project.clj again (right click -> add as lein project)