GNU bug report logs -
#71642
30.0.50; eglot-execute doesn't support ExecuteCommandParams
Previous Next
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 #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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.
This bug report was last modified 328 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.