lsp

dominicm 2025-07-24T09:51:17.663899Z

My coworker and I are experiencing an issue where clojure-lsp isn't sending the "params" attribute on the diagnostics being published, resulting in a startup error on neovim:

[DEBUG][2025-07-22 18:16:20] .../vim/lsp/rpc.lua:391	"rpc.receive"	{ jsonrpc = "2.0", method = "textDocument/publishDiagnostics" }
is this a known recent change?

dominicm 2025-07-24T10:00:56.927179Z

it's mixed in with good diagnostics, too. so some work OK, but some don't.

dominicm 2025-07-24T10:05:22.801239Z

2025.03.07-17.42.36 colleague has fixed by rolling back to this version. I'm guessing ba40d3d51 is a likely candidate for the cause given taht.

dominicm 2025-07-24T10:35:51.575039Z

e1f176b88c4af60563b9c0fb7fe88a7d100d5ffb git bisect is pointing at this commit

dominicm 2025-07-24T10:44:03.154079Z

I'm guessing this is because we have a custom clj-kondo lint, that is now being read somehow and ending up empty or blank somehow?

dominicm 2025-07-24T11:30:38.370119Z

Appears to be coming from the :used-underscored-binding lint. Creating a .clj-kondo/config.edn with {:linters {:used-underscored-binding {:level :warn}}} in a random clj project (java.jdbc, incidentally) resulted in this error appearing on my personal machine. Not sure why that particular SHA is interacting with that particular lint!

dominicm 2025-07-24T14:46:36.016589Z

Figured it out, :warn isn't recognized by level->severity so ends up as nil and https://github.com/SevereOverfl0w/clojure-lsp/blob/387f7c8806840346febe5bcc800f38eccde5ef29/cli/src/clojure_lsp/server.clj#L139-L144 runs even if it doesn't conform.

borkdude 2025-07-24T14:47:48.478769Z

:warning right?

dominicm 2025-07-24T14:49:26.356449Z

I reckon that's a big part of our mistake, yep! If we'd correctly used :warning this wouldn't have been a problem. It didn't flag up before that e1f... sha because level->severity was a case and would throw if there was an unknown level, resulting in no publishDiagnostic with a bad value.

dominicm 2025-07-24T14:50:24.021769Z

Ideally if failing to conform to a diagnostic, I imagine that clojure-lsp shouldn't send one!

ericdallo 2025-07-24T14:55:30.839989Z

I see, yeah, makes sense improve clojure-lsp to not send that

dominicm 2025-07-24T14:56:46.734209Z

easy solution: Change ->> to some->>?

dominicm 2025-07-24T14:56:57.293109Z

Given that conform-or-log results in a nil

dominicm 2025-07-24T15:04:06.766299Z

https://github.com/clojure-lsp/clojure-lsp/pull/2089 made that change here.

ericdallo 2025-07-24T15:04:50.924089Z

would be nice a test for that

ericdallo 2025-07-24T15:05:03.852999Z

but I think we don't have for that specific part of the code

ericdallo 2025-07-24T15:05:57.069709Z

Approved, but you need to fix conflicts

dominicm 2025-07-24T15:06:12.207409Z

@borkdude ha, we actually managed to encode :warn into our tests because kondo happily repeats whatever you give it.

dominicm 2025-07-24T15:06:35.911259Z

@ericdallo Great, thanks. I'm surprised there were conflicts already, it should have been a fresh pull! 🙂

ericdallo 2025-07-24T15:07:54.055029Z

I think you just had a outdated local branch 😅

dominicm 2025-07-24T15:08:41.733869Z

Yeah... I think I was using my fork as my origin. oops!

ericdallo 2025-07-24T15:24:05.455729Z

I believe you pushed with https://github.com/clojure-lsp/clojure-lsp/pull/2089#discussion_r2228844847

dominicm 2025-07-24T15:25:53.683459Z

Fixed, the tests did pass prior to my force pushing.