Fork me on GitHub
#emacs
<
2022-02-21
>
zhuxun223:02:04

Is there a way to eavesdrop the LSP packets between emacs and the clojure-lsp? I couldn't figure out why clojure-lsp/cljfmt is not working for my Emacs.

zhuxun223:02:09

@UKFSJSM38 Here is what I got from the log. Seems that the formatting request was returned with a null response:

zhuxun223:02:46

Does this mean cljfmt was not configured properly?

ericdallo23:02:50

it means there is nothing to format on that file

ericdallo23:02:02

do you have the sample code you are trying to format?

zhuxun223:02:32

Yeah, here is the file:

ericdallo23:02:10

what's your output of lsp-clojure-server-info ? the version specifically

zhuxun223:02:02

Here is the output of lsp-clojure-server-info

ericdallo23:02:19

you have a really outdated clojure-lsp

zhuxun200:02:55

hmm... I installed the latest clojure-lsp, but the problem remains

zhuxun200:02:03

Same file to format

zhuxun200:02:41

I noticed the ":cljfmt {:indents {}}" but I don't remember specifying that anywhere

ericdallo00:02:00

those are default ones for client-settings, it's expected

zhuxun200:02:11

Wait, it's working now

zhuxun200:02:17

Turns out I made a typo in my .cljfmt.edn which resulted in an invalid config for cljfmt

👍 1
zhuxun200:02:01

My bad... though it might be useful if clojure-lsp can report that kind of error somehow

zhuxun200:02:18

Unless cljfmt never reports error for invalid config

ericdallo00:02:58

unfortunately, cljfmt swallow the exception and just report there is no formatting

🙁 1
zhuxun200:02:19

That's too bad

zhuxun200:02:44

Thanks anyways!

👍 1