all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#71642: 30.0.50; eglot-execute doesn't support ExecuteCommandParams
@ 2024-06-19  3:24 Troy Brown
  2024-06-19 21:19 ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 11+ messages in thread
From: Troy Brown @ 2024-06-19  3:24 UTC (permalink / raw)
  To: 71642

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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-06-23 14:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-19  3:24 bug#71642: 30.0.50; eglot-execute doesn't support ExecuteCommandParams Troy Brown
2024-06-19 21:19 ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-19 22:26   ` João Távora
2024-06-20  3:55     ` Troy Brown
2024-06-20  9:46       ` João Távora
2024-06-21 12:14         ` Troy Brown
2024-06-21 13:51           ` João Távora
2024-06-22  8:44             ` João Távora
2024-06-22  9:48               ` Eli Zaretskii
2024-06-23 14:27                 ` Troy Brown
2024-06-23 14:35                   ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.