lsp

tvaughan 2024-08-15T16:10:59.270109Z

I'm using clojure-lsp to format an edn file that contains a long list of hash maps. Oddly the start of a hash map begins on the same line as the end of the previous hash map (shown below). Does anyone know of an option I can set that will align each hash map vertically using the same starting position on a line of its own? Thanks!

[{:db/id 64,
                      :schedule/after-ms 10000,
                      :schedule/device {:db/id 25,
                                        :device-id #uuid "70a2e52b-ff3b-439f-b0ce-92c54aaa097c",
                                        :device-name "Pump 4",
                                        :device-pin 23},
                      :schedule/id #uuid "52351295-29f9-4135-bc66-d5052a128c2d",
                      :schedule/state 0} {:db/id 65, ;; **PROBLEM IS HERE**
                                          :schedule/after-ms 37000,
                                          :schedule/device {:db/id 25,
                                                            :device-id #uuid "70a2e52b-ff3b-439f-b0ce-92c54aaa097c",
                                                            :device-name "Pump 4",
                                                            :device-pin 23},

ericdallo 2024-08-15T16:35:47.223829Z

I don't think cljfmt has an option for that

👌 1
Stig Brautaset 2024-08-15T17:04:00.661249Z

Is it possible :split-keypairs-over-multiple-lines? might do it? https://github.com/weavejester/cljfmt?tab=readme-ov-file#formatting-options

Stig Brautaset 2024-08-15T17:05:52.997939Z

... tho that case is not covered by the test cases I can find.

tvaughan 2024-08-15T17:37:00.811789Z

Thanks @stig328 I had forgotten about that option. Turns out I already have that set to true.