Fork me on GitHub
#emacs
<
2022-10-31
>
ag23:10:18

Does anyone know why lsp-mode won't respect :cljfmt :indents option? I have .lsp/config.edn in the project root. It has something like:

{:cljfmt {:indents
          {my-macro [[:inner 0]]}}}
Now, I expect (and I think it used to work) that if I run M-x lsp-format-buffer it would format it this way:
(my-macro foo bar
   (let [],,, )
but it still does this:
(my-macro foo bar
          (let [],,, )
Anyone knows how to diagnose and fix this?

ericdallo23:10:17

It's a clojure-lsp feature, could you paste lsp-clojure-server-info?

ag23:10:45

@UKFSJSM38 I figured it out

ag00:11:03

I'm using worktrees, and when you have a tree like this: . └── work └── my-project └── worktree 1 └── worktree 2 It expects the /.lsp/config.edn to be at my-project, not at "worktree 1" level. I dunno know why though. Maybe because there was /.lsp folder there already. Maybe I should try removing it.

ag00:11:11

nope, deleting it doesn't help. I had to to remove the root folder "my-project" from the workspaces.

ag00:11:50

it got confused because there was a workspace at "my-project" root, and then "sub-projects"/workspace folders inside.

ericdallo00:11:34

Clojure-lsp will check in the server root, which you configured lsp-mode previously

ag00:11:11

Right. Sorry for the noise.

👍 1