"Handle SERVER's METHOD notification with PARAMS.")
(cl-defgeneric eglot-execute-command (server command arguments)
- "Execute on SERVER COMMAND with ARGUMENTS.")
+ "Ask SERVER to execute COMMAND with ARGUMENTS.")
(cl-defgeneric eglot-initialization-options (server)
"JSON object to send under `initializationOptions'"
(cl-defmethod eglot-execute-command
(server command arguments)
- "Execute command by making a :workspace/executeCommand request."
- (jsonrpc-request
- server
- :workspace/executeCommand
- `(:command ,command :arguments ,arguments)))
+ "Execute COMMAND on SERVER with `:workspace/executeCommand'.
+COMMAND is a symbol naming the command."
+ (jsonrpc-request server :workspace/executeCommand
+ `(:command ,(format "%s" command) :arguments ,arguments)))
(cl-defmethod eglot-handle-notification
(_server (_method (eql window/showMessage)) &key type message)
(if (eq (setq retval (tmm-prompt menu)) never-mind)
(keyboard-quit)
retval))))))
- (if command-and-args
- (eglot-execute-command server (plist-get command-and-args :command)
- (plist-get command-and-args :arguments))
- (eglot--message "No code actions here"))))
+ (cl-destructuring-bind (&key _title command arguments) command-and-args
+ (if command
+ (eglot-execute-command server (intern command) arguments)
+ (eglot--message "No code actions here")))))
\f