GNU bug report logs - #71642
30.0.50; eglot-execute doesn't support ExecuteCommandParams

Previous Next

Package: emacs;

Reported by: Troy Brown <brownts <at> troybrown.dev>

Date: Wed, 19 Jun 2024 03:25:02 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 71642 <at> debbugs.gnu.org (full text, mbox):

From: Troy Brown <brownts <at> troybrown.dev>
To: João Távora <joaotavora <at> gmail.com>
Cc: Jeremy Bryant <jb <at> jeremybryant.net>, 71642 <at> debbugs.gnu.org
Subject: Re: bug#71642: 30.0.50;
 eglot-execute doesn't support ExecuteCommandParams
Date: Wed, 19 Jun 2024 23:55:10 -0400
[Message part 1 (text/plain, inline)]
On Wed, Jun 19, 2024 at 6:26 PM João Távora <joaotavora <at> gmail.com> wrote:
>
> Troy, you seem to be on to something.  It would seem Command shouldn't
> be there in the dcase matcher in eglot-execute at all.  Instead
> ExecuteCommandParams should be there.
>

I suspected that might be the case (that Command was really supposed
to be ExecuteCommandParams), but I hadn't exhaustively looked at
everything, however you have now confirmed that suspicion.

>
> I may just have been thrown off  by the confusing naming (naively
> thinking that executeCommand executes Commands, but it doesnt).
>

Yes, that makes sense, I was confused for a bit as well until I had
investigated why it had the "title" parameter, looked at the LSP
specification and realized that it was meant for something else.

> The reason no one has complained is probably that there aren't
> many users invoking custom commands, and if there are, they could
> be just using `jsonrpc-request` directly or using the deprecated
> interface.

Yes, that makes sense, I'd imagine people who are using custom
commands are using the older eglot-execute-command interface since
it's still functional.  I had looked at it and saw that it was now
deprecated so I attempted to use the new interface.

>  If so, patches welcome, as you
> seem to have grasped how this code is supposed to work.
>

I've attached a patch which I believe addresses the issue.  I did have
to reorder the interfaces to put CodeAction before
ExecuteCommandParams as both contain "command" parameters.  Since
eglot-strict-mode doesn't normally contain disallow-non-standard-keys,
it causes eglot--dcase to match ExecuteCommandParams for a CodeAction
interface if the optional "command" parameter is present.  Reordering
the interfaces allows them to match correctly since CodeAction
contains a required "title" parameter which is not present in the
ExecuteCommandParams interface.
[0001-Eglot-Fix-command-execution-bug-71642.patch (text/x-patch, attachment)]

This bug report was last modified 329 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.