Fork me on GitHub
#lsp
<
2021-05-26
>
practicalli-john21:05:28

When editing a (rather large) deps.edn file, something is adding 2 blank lines between a line comment and the keyword for an alias. I had assume this is cljfmt as lsp is configured to manage the formatting of code, but I have not seen any relevant rules to disable. Any idea if there is a rule to disable to stop these blank lines from being inserted

ericdallo21:05:01

I never saw something like that, do you have a repro? Is that only happens when formatting the file with clojure-lsp?

practicalli-john21:05:43

Yes, this only happens when I have clojure-lsp managing the formatting with Emacs The file in question is https://github.com/practicalli/clojure-deps-edn/blob/live/deps.edn

practicalli-john21:05:24

Making an edit, especially adding new sections triggers 2 blank lines in what seems to be all the aliases.

ericdallo21:05:23

Where thoses blank lines are added? I can't repro calling lsp-format-buffer

ericdallo21:05:57

Oh, I managed to repro

ericdallo21:05:11

it seems to add 2 blank lines below comments in a map

ericdallo21:05:31

this is totally cljfmt config and I don't know any rule/config that does that

ericdallo21:05:46

Maybe @UE21H2HHD knows how to disable that?

lread21:05:24

Hey ho! šŸ‘‹

practicalli-john21:05:08

It seems like an issue to raise on cljfmt. Thanks for trying this out. For now I can just kill the hunks that contain these unwanted changes using magit

šŸ‘ 1
lread21:05:31

Yeah nothing immediately coming to mind.

ericdallo21:05:27

@U05254DQM I managed to make a simpler repro:

{:foo 1


 ;; a
 :bar 2}
Formatting this gives me a:
{:foo 1


 ;; a


 :bar 2}

šŸ‘ 1
ericdallo21:05:47

it seems to be related with the extra lines above the comment

lread21:05:13

interesting! Happy to have a peek when issue is raised at cljfmt

lread23:05:49

Oh just had a memory of fixing something around this area: https://github.com/weavejester/cljfmt/issues/209 Are you folks on cljfmt master?

ericdallo00:05:09

@UE21H2HHD I am using on clojure-lsp latest cljfmt release, not master

lread02:05:30

Ya, Iā€™m pretty sure that fix is not released yet.