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

From: João Távora <[email-masked]>
Date: Tue, 4 Feb 2025 12:08:58 +0000

I've now pushed Javier's idea to Emacs master, sending eglot-{} instead of nil
as arguments to the shutdown request.

I'll leave it up to you whether to keep the bug open for "fixing"
this in jsonrpc.el (IMO it should be closed since the original problem is
solved).

João

On Fri, Aug 9, 2024 at 11:58 PM Daniel Pettersson
<[email-masked]> wrote:
>
>  Javier Olaechea <[email-masked]> writes:
>
> > I did sit down twice to read the jsonrpc.el code and understand what
> > I need to do to make the
> > change I hoped to. But unfortunately I can't even say I understood
> > jsonrpc--async-request-1 well
> > enough.Or even, if that is indeed the function we need to change so
> > that we don't seed a params
>
> As I see it there are two candidates:
>
> Modify calls to jsonrpc-connection-send (jsonrpc--async-request-1,
> jsonrpc-notify, to keep the behavior consistent) such that
> jsonrpc-connection-send is not called with keyword :params if params is
> nil.
>
> Or make the change in jsonrpc-convert-to-endpoint which makes the
> behavior part of jsonrpc.el's API.  We are already doing some
> sanitizing here before serialization of a similar character.
>
> I think both options are fine, but I would favor the second one.
>
> > attribute when params is nil. It seems that we are passing the
> > params down in multiple arms?
>
> Both solution candidates above should account for this.
>
> This sort of change does come with some extensive regression testing, as
> João mentioned.

-- 
João Távora