[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 1.2 d8c1f5d 026/101: Improve eglot-execute-command API to ease ov
From: |
Christian Johansson |
Subject: |
[elpa] 1.2 d8c1f5d 026/101: Improve eglot-execute-command API to ease overriding by servers |
Date: |
Thu, 29 Apr 2021 15:08:54 -0400 (EDT) |
tag: 1.2
commit d8c1f5d84d15cc2bb1c4c4d5244ad3d798bf63bd
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Improve eglot-execute-command API to ease overriding by servers
* eglot.el (eglot-execute-command): COMMAND can be a symbol.
(eglot-code-actions): Pass symbols to eglot-command.
---
eglot.el | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/eglot.el b/eglot.el
index e250ce0..e37ec94 100644
--- a/eglot.el
+++ b/eglot.el
@@ -159,7 +159,7 @@ lasted more than that many seconds."
"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'"
@@ -891,11 +891,10 @@ Uses THING, FACE, DEFS and PREPEND."
(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)
@@ -1586,10 +1585,10 @@ If SKIP-SIGNATURE, don't try to send
textDocument/signatureHelp."
(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")))))
- [elpa] 1.2 updated (f291816 -> e70be91), Christian Johansson, 2021/04/29
- [elpa] 1.2 1015f83 004/101: Per #48: Fix messages of eglot-ensure, Christian Johansson, 2021/04/29
- [elpa] 1.2 4a7086e 016/101: Per #59: eglot-workspace-configuration's keys needn't be keywords, Christian Johansson, 2021/04/29
- [elpa] 1.2 310e527 006/101: * README.md (Installation and usage): Add haskell-ide-engine, Christian Johansson, 2021/04/29
- [elpa] 1.2 f2a6aa3 010/101: Close #54: Correctly make LSP positions in narrowed buffers, Christian Johansson, 2021/04/29
- [elpa] 1.2 d845453 019/101: Close #60: Notify server of recent changes before save notification, Christian Johansson, 2021/04/29
- [elpa] 1.2 d8c1f5d 026/101: Improve eglot-execute-command API to ease overriding by servers,
Christian Johansson <=
- [elpa] 1.2 d48e737 017/101: Per #63: Accept functions as entries in eglot-server-programs, Christian Johansson, 2021/04/29
- [elpa] 1.2 b0c6e17 035/101: Add kotlin-language-server (#70), Christian Johansson, 2021/04/29
- [elpa] 1.2 38a27be 029/101: Add a test for eglot-ensure. Make, Christian Johansson, 2021/04/29
- [elpa] 1.2 05e5a9f 063/101: Per #63: Allow function contacts to be interactive, Christian Johansson, 2021/04/29
- [elpa] 1.2 922f4e5 060/101: Merge pull request #104 from mkcms/fix-diagnostics-wrong-type-argument, Christian Johansson, 2021/04/29
- [elpa] 1.2 7b78b15 055/101: Autoload eglot-ensure (#120), Christian Johansson, 2021/04/29
- [elpa] 1.2 bfadd9a 053/101: Close #100: Don't send other notifications before initialized, Christian Johansson, 2021/04/29
- [elpa] 1.2 737f08d 056/101: Correctly map DocumentSymbol's :kind to its name (#121), Christian Johansson, 2021/04/29
- [elpa] 1.2 3c9e00e 068/101: * .travis.yml (install): Download eclipse.jdt.ls server., Christian Johansson, 2021/04/29
- [elpa] 1.2 be464f2 005/101: Add entry for haskell-ide-engine in eglot-server-programs (#49), Christian Johansson, 2021/04/29