Subject: bug#66144: 29.1; eglot-shutdown request params violate JSONRPC

From: João Távora <[email-masked]>
Date: Sat, 14 Oct 2023 21:32:05 +0100

On Sat, Oct 14, 2023 at 9:14 PM Javier Olaechea <[email-masked]> wrote:
>
> > Can you test gopls shutdowns
> with your patch Javier?
>
> I have tested locally with gopls v0.11.0 and M-x
> eglot-shutdown works successfully afaict. Both w/o and
> w/ the patch applied.

Great, then I'd say we should first apply your patch.

> However I think it might be better to modify jsonrpc-request
> so that when the param argument is nil the JSON serialization
> omits the param key. I'm thinking of using the `,@(when param
> (list param)) idiom. jsonrpc has tests. I'd like to give it
> a go this weekend to see if I can come up with an acceptable
> way to have jsonrpc.el conform with the standard w/o changing
> the API. What do you think?

Maybe, but I don't know if it's worth it.  Especially because we
risk that other servers don't like this new behavior in particular.

It's a very risky change IMO.

Anyway, I would like to confirm some things:

* That the JSONRPC standard actually allows this.  I think you've
  done this already, but please double check.

* That the LSP Base Protocol, which is partially re-described in
  the LSP spec also seems to allow this.

* That the Eglot tests pass after this patch.  And ideally test
  this with some major servers, like rust-analyzer, pylsp,
  pyright, etc.

João