Fork me on GitHub
#cursive
<
2021-11-03
>
henryw37409:11:24

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

henryw37409:11:35

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

ericdallo12:11:09

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

onetom15:11:44

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)

cfleming20:11:45

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.

cfleming21:11:25

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

henryw37422:11:08

Sounds awesome 👍

roklenarcic14:11:29

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?

cfleming20:11:18

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)