Subject: bug#71642: closed (Re: bug#71642: 30.0.50; eglot-execute doesn't support ExecuteCommandParams)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 22 Jun 2024 09:50:01 +0000

Your bug report

#71642: 30.0.50; eglot-execute doesn't support ExecuteCommandParams

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
71642: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71642
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#71642: 30.0.50; eglot-execute doesn't support ExecuteCommandParams
From: Eli Zaretskii <[email-masked]>
To: João Távora <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Sat, 22 Jun 2024 12:48:52 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: João Távora <[email-masked]>
> Date: Sat, 22 Jun 2024 09:44:59 +0100
> Cc: Jeremy Bryant <[email-masked]>, [email-masked]
> 
> On Fri, Jun 21, 2024 at 2:51 PM João Távora <[email-masked]> wrote:
> >
> > On Fri, Jun 21, 2024 at 1:14 PM Troy Brown <[email-masked]> wrote:
> >
> > > I've updated the patch based on your suggestions.
> >
> > Looks good, thanks!
> >
> > The only doubt I have is the Copyright Assignment.  This is still a
> > "trivial" patch  (< 15 LOC), I think but I'll need to ask Eli for
> > his opinion to be sure.
> >
> > Eli, if you're OK with the copyright aspects, please install this
> > and close the bug.
> 
> Now actually copying in Eli.

Thanks, I installed this, and I'm therefore closing the bug.

Troy, if you want us to be able to accept your contributions in the
future, please consider starting the copyright assignment paperwork at
this time.  (If you agree, I will send you the form to fill and the
instructions to go with it.)

Subject: 30.0.50; eglot-execute doesn't support ExecuteCommandParams
From: Troy Brown <[email-masked]>
To: [email-masked]
Date: Tue, 18 Jun 2024 23:24:04 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

With the deprecation of eglot-execute-command and its referral to
eglot-execute, it would seem that eglot-execute should support the
same command and arguments to send the workspace/executeCommand
request to the server.  Unfortunately, this doesn't seem to work as
expected.  I would have expected the following to work:

(eglot-execute (eglot-current-server) '(:command "my-command"))

The reason this doesn't work is because within eglot-execute, the use
of eglot--dcase is configured to only match Command or CodeAction.
Command requires that there be a "title" parameter, but this doesn't
exist in the workspace/executeCommand request.  In fact, if the above
"eglot-execute" example is changed to add a ":title" parameter, it
will erroneously send a workspace/executeCommand with a title
parameter.

The following example can be used to illustrate that the Command
interface (which is intended for code actions, not for sending an
executeCommand) doesn't match for this simple case:

(condition-case err
    (eglot--dcase '(:command "my-command")
      (((Command)) (message "Matched command")))
  (error
   (message "%s" (cdr err))))

It appears that an ExecuteCommandParams interface should be added to
eglot--lsp-interface-alist and that a matcher for ExecuteCommandParams
should be added to the eglot--dcase in eglot-execute.  Additionally,
the Command matcher should be changed to not send the "title"
parameter in the subsequent workspace/executeCommand request.