calva

2026-04-15T01:10:16.398689Z

👋 Thanks for making Calva, awesome project! One feature that I use often is clojure-lsp Refactor: Extract to New Function It seems to have stopped working for me, and I’m not sure how to debug it… When I execute the command, I get an alert toast with this message: Request workspace/executeCommand failed. When I follow the Go to output prompt in the alert toast, I see this in the OUTPUT panel

[Error - 6:39:01 PM] Request workspace/executeCommand failed.
  Message: Internal error
  Code: -32603 
[object Object]
I’m using Calva version 2.0.573 More info from Calva Says tab in the OUTPUT panel:
Calva version used: v2.0.573
clojure-lsp version used: 2026.02.20-16.08.58
clj-kondo version used: 2026.01.19
clojure-lsp version used: 2026.02.20-16.08.58
clj-kondo version used: 2026.01.19
VSCode info:
Version: 1.115.0 (Universal)
Commit: 41dd792b5e652393e7787322889ed5fdc58bd75b
Date: 2026-04-07T22:04:57Z
Electron: 39.8.5
ElectronBuildId: 13703022
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin x64 24.5.0
Any help with this is appreciated!

JR 2026-04-25T01:41:47.116709Z

Oops, I just saw this now. I'll add it to my list to visit soon

seancorfield 2026-04-25T01:43:59.494079Z

FWIW, the failure I'm seeing with clean ns form seems intermittent.

ericdallo 2026-04-26T14:13:08.977099Z

at least for lsp-mode was easy as call the command, https://github.com/emacs-lsp/lsp-mode/issues/5023

JR 2026-04-26T17:48:41.269649Z

I'll try lsp-mode. I've been trying Calva 2.0.573 and I can't get it to reproduce. Maybe it's something about my environment (Fedora). In any case, given the stack I can make a guess

ericdallo 2026-04-26T17:49:22.675789Z

I believe there was a fix in calva related to that as well?

JR 2026-04-26T17:50:53.191619Z

Yeah, but the OP report was on 2.0.573. Prior to that I had tried commenting out the fix in the Calva commit (5ff1bd7) and rebuilding the VSIX but I couldn't reproduce there

JR 2026-04-26T18:02:41.182959Z

I have an old version of lsp-mode and a dev version of clojure-lsp. Am I doing something dumb to not reproduce this?

JR 2026-04-26T18:25:58.076429Z

Here's Extract Function with Calva and (versions from OP) Calva version used: v2.0.573 clojure-lsp version used: 2026.02.20-16.08.58 There must be something I'm doing different, but I don't see it

JR 2026-04-26T18:30:59.150849Z

Hm... actually, I could check if I'm getting more than three arguments logged, and even reproduce it that way if I can't do it manually

JR 2026-04-26T18:35:17.942299Z

Sure enough, I'm always getting 6 arguments for some reason.

"command": "extract-function",
            "arguments": [
                "file:///path/to/state.clj",
                671,
                3,
                "new-function",
                671,
                3
When not selecting something, the last two args (row,col) are the same as first two

jramosg 2026-04-26T18:39:02.282539Z

Have you tried with Command Palette? I was able to reproduce like that

JR 2026-04-26T18:39:32.978719Z

That is it! Thank you!!!

👌🏿 1
JR 2026-04-26T18:54:21.993519Z

Easy fix, I'll open it on clojure-lsp. Duh! When I created this bug I had convinced myself that my little shortcut was OK because clojure-lsp is returning a 6 arg version as a code action. I didn't realize clients could construct their own code actions

JR 2026-04-26T19:07:15.937299Z

Filed: https://github.com/clojure-lsp/clojure-lsp/issues/2276

pez 2026-04-25T08:47:52.151469Z

I think that latest Calva is no longer tripping on this one. @jonurnieta ?

jramosg 2026-04-25T10:35:47.664139Z

The issue with “Extract to new function” was fixed, but I didn’t make any changes to this one. I use it regularly and haven’t been able to reproduce it yet. If I can see the console error, I might be able to investigate further. 🙏🏿

pez 2026-04-25T10:52:29.517699Z

Ah! Thanks. There are too many features in Calva! 😃

😄 1
JR 2026-04-26T00:33:30.865779Z

I see, I'm off the hook for "Extract to new function", it was fixed by @jonurnieta in Calva via https://github.com/clojure-lsp/clojure-lsp/issues/2118 and https://github.com/BetterThanTomorrow/calva/pull/3174. Yeah, this looks like it is due to something I added to support selection in function extraction in clojure-lsp. This reminds me that I have some changes to add a few new clojure-lsp refactorings to Calva that I should submit.

ericdallo 2026-04-26T01:14:21.045049Z

@john.t.richardson.dev I had to fix lsp-mode as well and we might need to do the same for nvim and clojure-lsp-intellij, or we do a fix in Clojure-lsp if possible

JR 2026-04-26T01:20:10.549359Z

I wonder how I didn't see this? Is there a reproducer that I'm missing?

2026-04-15T08:20:48.075119Z

ok thanks! I also recently noticed something which seems like a regression. When I hit tab to reformat a map with Calva Format: Format and Align Current Form, it inserts a newline after the opening bracket. If I install a Calva version from a couple months ago, the problem goes away. Maybe there is a setting I could tweak to fix this?

👀 1
jramosg 2026-04-15T08:27:13.221009Z

I think it's a cljfmt bug that has just been fixed https://github.com/weavejester/cljfmt/pull/409

jramosg 2026-04-15T08:27:56.830529Z

when calva updates cljfmt to https://github.com/weavejester/cljfmt it may be fixed

pez 2026-04-15T08:30:34.574999Z

Please file it as an issue, so that it people can find it and we can comment there about the possible coming fix.

seancorfield 2026-04-15T18:53:01.092789Z

I get the same OP error trying to run clojure-lsp Refactor: Clean NS Form. My versions: Calva version used: v2.0.573 clojure-lsp version used: 2026.03.30-12.34.10-nightly clj-kondo version used: 2026.01.20-SNAPSHOT I just updated clojure-lsp and the issue persists: clojure-lsp version used: 2026.04.15-12.53.12-nightly clj-kondo version used: 2026.04.15 Should an issue be opened for that too? Or maybe I'll just forward this thread to #lsp to see what Eric wants to do...

pez 2026-04-15T18:54:58.203349Z

Yes, issue for that one too would be good.

seancorfield 2026-04-15T18:55:19.741759Z

Is it a Calva issue or an LSP issue tho'?

ericdallo 2026-04-15T18:57:29.839089Z

does this happens only in nightly or stable clojure-lsp?

seancorfield 2026-04-15T19:00:00.829549Z

Several versions are mentioned in this thread -- OP was using a stable version from February, I was using two different nightly versions.

ericdallo 2026-04-15T19:03:45.365869Z

refactors are working in my latest clojure-lsp nightly in my emacs, so it could be a calva issue

ericdallo 2026-04-15T19:03:54.842619Z

let me try calva

ericdallo 2026-04-15T19:06:16.191929Z

Yeah I can repro with calva, let me check deeper

ericdallo 2026-04-15T19:10:00.751419Z

clojure-lsp is throwing a exception

com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine     PlatformThreads.java: 872
com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine     PlatformThreads.java: 896
                                         java.lang.Thread.run              Thread.java:1583
                                     java.lang.Thread.runWith              Thread.java:1596
           java.util.concurrent.ThreadPoolExecutor$Worker.run  ThreadPoolExecutor.java: 642
            java.util.concurrent.ThreadPoolExecutor.runWorker  ThreadPoolExecutor.java:1144
       java.util.concurrent.CompletableFuture$AsyncSupply.run   CompletableFuture.java:1768
                                    promesa.util.Supplier/get                util.cljc:  34
                                promesa.exec/wrap-bindings/fn                exec.cljc: 200
                                    clojure-lsp.server/fn{x2}               server.clj: 449
                         clojure-lsp.handlers/execute-command             handlers.clj: 375
                     clojure-lsp.feature.command/call-command              command.clj: 228
                                                          ...
java.lang.IndexOutOfBoundsException:

ericdallo 2026-04-15T19:12:23.802209Z

I believe it's related with https://github.com/clojure-lsp/clojure-lsp/issues/2118 c/c @john.t.richardson.dev

seancorfield 2026-04-15T19:15:27.582179Z

It feels like this only starting to break recently? I haven't tried going back through Calva versions to see if there's an older version that still works...

pez 2026-04-15T19:18:32.456439Z

I don’t think something has changed in Calva around this since September last year.

ericdallo 2026-04-15T19:20:24.698599Z

yeah me too, my guess this is broken for some time for this command especifically, other commands work

pez 2026-04-15T19:24:32.776339Z

Refactors can be dome via the refactor command and as separate commands. Maybe one works and the other doesn’t, and that limits the blast radius…

jramosg 2026-04-15T19:26:51.258259Z

I reproduce the extract to new function error but not clojure-lsp Refactor: Clean NS Form

👍 2
seancorfield 2026-04-15T02:40:30.271339Z

I've seen this error occasionally but haven't tracked it down to a single command or file. I'm using nightly:

Calva version used: v2.0.573
clojure-lsp version used: 2026.03.30-12.34.10-nightly
clj-kondo version used: 2026.01.20-SNAPSHOT

pez 2026-04-15T05:09:48.143699Z

From the error it looks like it goes boom in clojure-lsp. So it could be worth bisecting it with some previous versions of the lsp server.