lsp

Stig Brautaset 2025-09-22T16:59:30.400819Z

It looks like formatting via clojure-lsp no longer picks up .cljfmt.edn -- both when running egtlot-format-buffer via a before-save-hook in Emacs, and when running clojure-lsp format in a terminal. However, when running lein cljfmt fix it does pick up .cljfmt.edn. (The project.clj contains :cljfmt {:load-config-file? true} .) Is there any known regression / change around this? (I'm not sure when exactly this started happening.)

Stig Brautaset 2025-09-22T17:01:08.224679Z

I'm prepared to believe I've messed up something in my environment, but I have no idea what!

Stig Brautaset 2025-09-22T17:02:47.640339Z

Symptoms are similar to https://github.com/clojure-lsp/clojure-lsp/issues/1778

ericdallo 2025-09-22T17:07:51.614499Z

Let me check

Stig Brautaset 2025-09-22T17:11:54.940759Z

fwiw my .cljfmt.edn looks like this: (Tonsky format FTW.)

{:paths ["src" "test" "common/src" "common/test" "client/src" "client/test" "dev-src"]
 :indents {#re "^\\w" [[:inner 0]]}}

Stig Brautaset 2025-09-22T17:12:26.989009Z

I'll see if I can do a minimal example.

ericdallo 2025-09-22T17:14:01.553249Z

I believe :indents was deprecated in favor of extra-indents as it overrides all cljfmt indents

ericdallo 2025-09-22T17:14:07.081439Z

I'd try that first

Stig Brautaset 2025-09-22T17:29:30.290709Z

Using extra-indents didn't help, but thank you for the suggestion 🙂 Here's a repro. https://github.com/stig/clojure-format-example/commit/a62d2ee37ec48b639090b780648398c819a4d583

Stig Brautaset 2025-09-22T17:30:56.513919Z

Huh, maybe you're onto something... changing to :extra-indents made cljfmt fix stop working too 🙂 nah, it's just that we override all internal rules. But that makes me wonder if clojure-lsp somehow sets the :legacy/merge-indents? true option. That would be weird, but I think it would explain what I'm seeing.