[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot c8191b2 32/62: Improve eglot-execute-command API
From: |
Stefan Monnier |
Subject: |
[elpa] externals/eglot c8191b2 32/62: Improve eglot-execute-command API to ease overriding by servers |
Date: |
Sat, 29 Sep 2018 17:13:33 -0400 (EDT) |
branch: externals/eglot
commit c8191b24e25ba4bc8f4f0e972d5f0084f9280d09
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
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] externals/eglot 15040a6 48/62: Improve snippet support, (continued)
- [elpa] externals/eglot 15040a6 48/62: Improve snippet support, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot d88f6aa 54/62: Close #86: Handle case when :textDocumentSync isn't a number, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 42fffa5 16/62: Close #54: Correctly make LSP positions in narrowed buffers, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot e935718 20/62: Fix placement of diagnostics with same start and end positions, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 88ebed6 17/62: Implement TextDocument/rangeFormatting, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 792dc6b 28/62: * eglot.el (advice-add jsonrpc-request): Add &allow-other-keys, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 21886be 08/62: Close #44: Robustify in the face of manual mode changes, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 6b14711 18/62: * eglot.el (eglot-client-capabilities): Fix a typo., Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 4c019bd 24/62: * eglot.el (eglot-initialization-options): Fix spurious typo., Stefan Monnier, 2018/09/29
- [elpa] externals/eglot a62c2da 25/62: Close #60: Notify server of recent changes before save notification, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot c8191b2 32/62: Improve eglot-execute-command API to ease overriding by servers,
Stefan Monnier <=
- [elpa] externals/eglot 991d129 34/62: * README.md (Build Status): Show status for master, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot ae37c2a 35/62: Add a test for eglot-ensure. Make, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot cac728a 33/62: Kill server's output and events buffers from eglot-shutdown (#66), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 9ae03af 39/62: Close #41: Control the size of the events buffer, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot c25c0e3 40/62: Close #64: handle edits to same position in the correct order, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 6874895 42/62: Close #73: Prompt for server in interactive eglot-shutdown, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot dc26745 38/62: Update README.md, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot e05360a 50/62: Actually add snippet example gif referenced in README.md, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot c8cccee 52/62: Ignore extra keys in textDocument/publishDiagnostics (#81), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 6f1d64c 59/62: Close #100: Don't send other notifications before initialized, Stefan Monnier, 2018/09/29