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


View this message in rfc822 format

From: Jeremy Bryant <jb <at> jeremybryant.net>
To: Troy Brown <brownts <at> troybrown.dev>
Cc: 71642 <at> debbugs.gnu.org, João Távora <joaotavora <at> gmail.com>
Subject: bug#71642: 30.0.50; eglot-execute doesn't support ExecuteCommandParams
Date: Wed, 19 Jun 2024 22:19:17 +0100
Troy Brown <brownts <at> troybrown.dev> writes:

> 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.

Adding João as author of eglot




This bug report was last modified 1 year and 20 days ago.

Previous Next


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