lsp

:clojure-lsp: Clojure implementation of the Language Server Protocol: https://clojure-lsp.io/
practicalli-john 2021-05-26T21:37:28.064100Z

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

ericdallo 2021-05-26T21:39:01.064400Z

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

practicalli-john 2021-05-26T21:39:43.064700Z

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-john 2021-05-26T21:41:24.065100Z

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

ericdallo 2021-05-26T21:42:23.065300Z

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

ericdallo 2021-05-26T21:42:57.065500Z

Oh, I managed to repro

ericdallo 2021-05-26T21:43:11.065700Z

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

ericdallo 2021-05-26T21:43:31.065900Z

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

ericdallo 2021-05-26T21:43:46.066100Z

Maybe @lee knows how to disable that?

lread 2021-05-26T21:45:24.066300Z

Hey ho! 👋

practicalli-john 2021-05-26T21:46:08.066500Z

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
lread 2021-05-26T21:46:31.066800Z

Yeah nothing immediately coming to mind.

ericdallo 2021-05-26T21:49:27.067Z

@jr0cket I managed to make a simpler repro:

{:foo 1


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


 ;; a


 :bar 2}

👍 1
ericdallo 2021-05-26T21:49:47.067200Z

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

lread 2021-05-26T21:56:13.067400Z

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

lread 2021-05-26T23:50:49.067700Z

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